By Jeff Horwitz and Newley Purnell

A Facebook Inc. executive at the center of a political storm in India made internal postings over several years detailing her support for the now ruling Hindu nationalist party and disparaging its main rival, behavior some staff saw as conflicting with the company's pledge to remain neutral in elections around the world.

In one of the messages, Ankhi Das, head of public policy in the country, posted the day before Narendra Modi swept to victory in India's 2014 national elections: "We lit a fire to his social media campaign and the rest is of course history."

"It's taken thirty years of grassroots work to rid India of state socialism finally," Ms. Das wrote in a separate post on the defeat of the Indian National Congress party, praising Mr. Modi as the "strongman" who had broken the former ruling party's hold. Ms. Das called Facebook's top global elections official, Katie Harbath, her "longest fellow traveler" in the company's work with his campaign. In a photo, Ms. Das stood, smiling, between Mr. Modi and Ms. Harbath.

Ms. Das's posts, which were viewed by The Wall Street Journal, haven't been previously reported. Some Facebook employees said the sentiments and actions described by Ms. Das conflicted with the company's longstanding neutrality pledge.

The posts cover the years 2012 to 2014 and were made to a Facebook group designed for employees in India, though it was open to anyone in the company globally who wanted to join. Several hundred Facebook employees were members of the group during those years.

Ms. Das is already at the center of a political outcry in India over Facebook's handling of hate speech on the platform, following a Journal article earlier this month. That article showed that Ms. Das earlier this year opposed moves to ban from the platform a politician from Mr. Modi's party whose anti-Muslim comments violated Facebook's rules.

From its earliest days when it morphed from a college social network into a global political force, Facebook has presented itself as a neutral platform that doesn't favor any party or viewpoint. The company's head of global affairs, Nick Clegg, has said the company's role is to provide the court, not "pick up a racket and start playing." Chief Executive Mark Zuckerberg has repeatedly stressed his position that the company should remain politically neutral, including this year when he defended his decision not to act against provocative posts from U.S. President Trump.

Facebook on Tuesday said the posts by Ms. Das don't show inappropriate bias.

"These posts are taken out of context and don't represent the full scope of Facebook's efforts to support the use of our platform by parties across the Indian political spectrum," spokesman Andy Stone said.

Ms. Das didn't respond to multiple requests for comment. She has apologized to colleagues for sharing a post described in the previous Journal article, in which she approvingly reposted an essay from a former Indian police official who said the country's Muslims have historically been "a degenerate community."

As in the U.S., Facebook's India-based public policy team serves two functions. Staffers make and enforce the platform's rules about what is and isn't allowed to be posted, and they represent the company's interests before governments. Critics both outside the company and inside have increasingly raised concerns about how those roles may conflict.

Opposition lawmakers in India are seeking to question Facebook executives following the Journal's recent article, and Facebook employees are pressing company leadership to investigate why the company hasn't done more to address toxic content in a country with a recent history of lynchings and communal violence. A nonpartisan group of 54 former civil servants in India on Monday circulated an open letter to Mr. Zuckerberg, asking him to audit the implementation of Facebook's hate-speech policy in the country.

A spokesman called the employee requests "a prime example of the type of open culture we value at Facebook" and said the company stands against anti-Muslim bigotry.

India is a key market for Facebook because its nascent internet economy represents mammoth room for growth. Facebook in April said it was investing $5.7 billion on a new tie-up with an Indian telecom operator, its biggest foreign investment to date. Facebook India reports directly to Facebook's top executives in Menlo Park, Calif., exempting Ms. Das's team from regular oversight by both Facebook's leadership in Asia and Facebook's global public policy team.

Ms. Das arrived at Facebook in 2011, a time when the social media giant was eager to demonstrate its utility in politics. It rolled out training for several Indian political parties on how best to use the platform to mobilize supporters. One was Mr. Modi's 2012 campaign for re-election as chief minister of the western Indian state of Gujarat.

Mr. Modi's political career had been sullied by deadly religious riots in the state in 2002, soon after he came to power. Critics accused him of not doing enough to stop the violence that killed more than 1,000 people, most of them Muslims, allegations Mr. Modi denied. A court in 2013 said there wasn't enough evidence to prosecute him, but he was barred on human-rights grounds from visiting the U.S. before his election as prime minister.

"Success in our Gujarat Campaign," Ms. Das wrote of the training of Mr. Modi's Bharatiya Janata Party team in October of 2012, noting the campaign was close to reaching a million fans on Facebook.

Mr. Modi soon launched his campaign for national office, with Facebook again offering training and assistance. Her Facebook colleague, Ms. Harbath -- a Republican -- wrote that Ms. Das characterized Mr. Modi as "the George W. Bush of India," according to a 2013 internal post featuring a photo of the two women and the future prime minister. Facebook said it offered similar meetings and training to other parties during Ms. Harbath's time in India.

Ms. Das made her sentiments on the race clear. When a fellow staffer noted in response to one of her internal posts that the BJP's primary opponent, the Indian National Congress, had a larger following on Facebook than Mr. Modi's individual page, Ms. Das responded: "Don't diminish him by comparing him with INC. Ah well -- let my bias not show!!!"

Internally, Ms. Das presented the company's work with the BJP as benefiting Facebook as well.

"We've been lobbying them for months to include many of our top priorities," she said of the BJP's official platform, noting that the document was littered with the word "technology" and appeared to embrace Facebook's desire for an expanded but less heavily regulated internet. "Now they just need to go and win the elections," she wrote.

By the end of the 2014 national campaign, Ms. Das shared with colleagues internal BJP election predictions of a Modi victory that she said she had obtained from a "senior leader and close friend in BJP."

The Journal previously reported that Ms. Das had intervened to prevent Facebook from calling out the BJP as it did Congress for operating networks of fake pages and accounts during India's 2019 national elections. Facebook denied that its handling of the announcement was biased in the BJP's favor.

In another incident, which hasn't been previously reported, Facebook declined to act after discovering that the BJP was circumventing its political ad transparency requirements, according to people familiar with the matter.

The rules require advertisers to verify their identities and disclose them to users. In addition to buying Facebook ads in its own name, the BJP was also found to have spent hundreds of thousands of dollars through newly created organizations that didn't disclose the party's role, the people said.

Facebook neither took down the pages nor flagged the ads. Instead, it privately raised the matter with the BJP, according to former employees in both India and the U.S., where the decision was discussed.

Facebook's Mr. Stone Tuesday said that Facebook decided not to act after concluding that its rules hadn't been specific enough. The company said it has decided to review that decision following the Journal's questions this past week. A spokesman for the BJP didn't respond to a request for comment.

Write to Jeff Horwitz at Jeff.Horwitz@wsj.com and Newley Purnell at newley.purnell@wsj.com