Modernizers and the party’s old guard had tussled for supremacy at this month’s pivotal party congress, but General Secretary Nguyen Phu Trong emerged unopposed to stay in the role.

For a while, it appeared that Prime Minister Nguyen Tan Dung, the charismatic, pro-business premier, might prevail. He cultivated a popular base in the party and the country at large by promising economic revamps and by taking a tougher, nationalist stance toward China and the two countries’ territorial disputes in the South China Sea.

But this month, The Wall Street Journal and other publications reported that Mr. Trong used concerns about Mr. Dung’s growing influence to prevent the Politburo nominating him as a candidate to become general secretary, the most powerful post in Vietnam and one that could set the direction of the country and its economy for years to come.

On Sunday, some of Mr. Dung’s supporters nominated him to rejoin the party’s central committee—a step that could have enabled him to contest Mr. Trong for party leadership before the Congress wraps up on Jan. 28.

Delegates were still discussing the matter late Monday before state media reported that Mr. Dung would leave the top levels of the party.

Mr. Dung couldn’t be reached to comment.

Details of the power tussle have spilled over onto social-media networks and blogs here for weeks, fueled by the Vietnamese public’s desire for a glimpse of a hidden world.

For decades, Vietnam’s communist leaders had cloistered themselves away every five years to pick the country’s next leader in a carefully choreographed and predetermined affair.

Before Monday’s resolution, many experts said the most notable shift was how much of the infighting is spilling out into the open.

“Whatever the outcome of the congress, the Communist Party won’t be the same again,” wrote one prominent blogger here, Truong Huy San.

Jonathan London, a professor at City University of Hong Kong and an expert on Vietnam, said the growing number of Vietnamese-language blogs and commentary in social media is pressuring the party to adopt more openness in how the country picks its leaders.

“Vietnam’s politics are developing faster than its political elites are prepared to admit,” Mr. London said. “Vietnamese from diverse walks of life are discussing the nation’s politics in an increasingly open and self-confident manner.”

Much of this change is being driven by the Internet. Television and newspapers are strictly controlled by the communist state, leaving many Vietnamese to look online for an alternative take on what is happening in the country. Nearly half of Vietnamese regularly use the Web, with that figure rising to two-thirds for those under 30, many of whom use smartphones and other mobile devices to go online.

At the previous party congress in 2011, there was much less access to the Web and the mobile Internet phenomenon driving the medium’s growth today barely registered.

This transformation unsettles the country’s leaders. The government has tried to stamp out what it calls “toxic activity” on social media and has blocked popular political blogs such as Anh Bah Sam, which roughly translates to “Someone in the Know.” It has also used its new Facebook page to complain about what it says are misleading and premature reports about the political horse-trading at the party congress.

“These pages are most distorting and talking bad about our party’s leaders, government and policies,” Truong Minh Tuan, deputy minister of information, wrote in a recent post. Mr. Tuan’s Facebook use itself underlines the shift, especially in relation to China, where the site is still blocked.

Now that this week’s political contest appears to be over—Mr. Trong is expected to be confirmed as party chief—Vietnam experts say the country will likely continue developing its blossoming trade and military relationships with the U.S. some 40 years after the end of the Vietnam War. Last year, Mr. Trong became Vietnam’s first Communist Party chief to visit America.

But the question of how to handle the Internet will likely be near the top of the new leadership team’s to-do list.

Some analysts say that Vietnam’s leaders might opt to step up less formal ways of discouraging more open discussions of what is happening in the country. Zachary Abuza, a professor at the National War College in Washington, notes that human-rights groups report that several bloggers have been roughed up by street toughs over the past year.

Still, “it’s hard to imagine that all this is going to swept aside,” Mr. London said. “We could be seeing a transition to a more open but as yet unknown form of government.”

By James Hookway - The Wall Street Journal - January 25, 2016