NAIROBI, Kenya—Somalia’s president has appointed a new prime minister after parliament voted out the previous one following a political feud.

President Hassan Sheikh Mohamud on Wednesday appointed Omar Abdirashid Ali Sharmarke, who resigned as prime minister in 2010 after tensions with former President Sheik Sharif Sheik Ahmed.

Parliament voted former Prime Minister Abdiweli Sheikh Ahmed out of office this month, capping a long-standing feud between him and the president.

The U.S. and United Nations, among others, have warned that the political infighting in Somalia is putting the country’s recent security gains at risk.

—Copyright 2014 Associated Press