Vietnam's prime minister stepped down on Wednesday after 10 years in office, leaving behind a mixed legacy of promoting failed state enterprises but at the same time attracting foreign investment and daring to challenge China.

In a formal vote, 430 of 462 members of the rubber-stamp National Assembly voted to remove Nguyen Tan Dung, three months before the end of his term, the government said on its website.

Dung's departure was a mere formality after he lost a leadership battle during the ruling Communist Party's congress in January. Dung lost to Nguyen Phu Trong, who was re-elected party general secretary for a second five-year term.

The National Assembly is scheduled to appoint Dung's deputy, Nguyen Xuan Phuc, as prime minister on Thursday. In Vietnam, the Communist Party general secretary, the prime minister and the president form the triumvirate of power.

Dung was easily the most high-profile prime minister Vietnam ever had. He was charismatic, a good orator and mixed easily with foreign leaders, which raised the country's profile. But within the party he was blamed for the failures of huge state-owned enterprises including the monumental collapse of the Vietnam Shipbuilding Industry Group and Vietnam Shipping Lines. Many of the state owned enterprises ended up with mountains of public debt.

"Over the course of his tenure, Dung distinguished himself as a highly public and entrepreneurial leader, even as the substance of his policy initiatives drew criticisms from both conservative and reform elements within the party," Jonathan London, a Vietnam expert at the City University of Hong Kong, said in an email interview.

Also, Dung's closeness with numerous newly and unusually wealthy Vietnamese raised suspicions among many. "Be that as it may, during Dung's tenure, Vietnam continued to grow and draw large-scale foreign investment, defying regional and global trends," said London.

Dung's position as an experienced leader will be hard to fill.

"Dung's successor, Nguyen Xuan Phuc, who comes to the office with considerable less punching power, is a study in contrast with Dung," said London. "In essence, none among Vietnam's current leaders will fill Dung's shoes."

Dung took office in 2006, during the global financial crises, followed by a global economic slowdown that severely impacted Vietnam, which at the time and even today largely depends on foreign investment and trade for economic growth.