TRIPOLI, Oct 7 (Reuters) - Libya’s national congress dismissed the newly elected prime minister on Sunday in a vote of no confidence which underscored the difficulties of forming a government which can unite the country’s different factions and regions.

The vote came minutes after prime minister Mustafa Abushagur named 10 new ministers - his second and ultimately unsuccessful attempt to form a government - after he was forced to withdraw his previous cabinet in the face of protests.

The national congress will now need to choose a new prime minister who will have to try again to form a viable government as Libya, a major oil and gas exporter, seeks to emerge from the civil war that toppled Muammar Gaddafi last year.

Abushagur was elected by the assembly on Sept 12 and last week announced a government which included 29 ministries.

He withdrew the list after protests from the national congress and the public saying it was not representative of the country. Between 100 and 150 demonstrators from the western town of Zawiyah stormed the national congress on Thursday.

The original list had many unknown figures, and was believed to include several members of the political arm of the Muslim Brotherhood. But there were no candidates from the National Forces Alliance, Libya’s leading liberal coalition.

After withdrawing his initial choice, Abushagur was then given 72 hours to name a new government acceptable to the national congress or face a vote of no confidence.

He said he had come under pressure by political parties demanding roles in certain ministries.

“The first list was not successful, it had some mistakes, and I was prepared to fix it,” he told the national congress on Sunday. “Some political entities that demanded certain positions began to discuss a vote of no-confidence. I would not bow down to the pressure of political entities.”

Libya desperately needs a viable government so that it can focus on reconstruction and on healing regional divisions opened up by the war which toppled Gaddafi.

Hamuda Syala, spokesman for the National Forces Alliance led by wartime rebel prime minister Mohammed Jibril, said the coalition had been let down by Abushagur’s original list of ministerial appointments.

But he said the National Forces Alliance was in negotiations with the Muslim Brotherhood’s political arm, the Justice and Development Party, to find “a suitable leader who will be representative of Libya’s choice”.

Abushagur appeared on state television late at night to offer his thanks to those who helped him.

“I call on the revolutionaries to take care of this country and not let anyone take advantage of it,” he said. “I am ready to be a servant to this country and it will be a big honour to keep serving it.”