The two men have locked horns over top security appointments and dismissals in a dispute that has stoked fears for Somalia's stability.
Somali President Mohamed Abdullahi Mohamed has suspended the prime minister's power to hire and fire officials, he said in a statement, escalating a destabilising row in the Horn of Africa nation.
The dispute between Mohamed and Prime Minister Mohammed Hussein Roble, nominally over a murder investigation, has generated months of tension in a country riven by militant attacks and clan rivalries.
"The prime minister violated the constitution," the president said in the statement, saying the suspension would last until the conclusion of elections later this year.
Roble said he would not abide by the president's order and accused him of twisting the constitutional provisions he cited to justify his interference with the powers of the prime minister's office.
"The prime minister reminds the president to preserve the principles of the constitution of the separation of powers of the government's institutions," he said in a statement issued by his office.
Mohamed and Roble first clashed in April, when the president unilaterally extended his four-year term by two years, prompting army factions loyal to each man to seize rival positions in the capital, Mogadishu.
The confrontation was resolved when the president put Roble in charge of security and organising delayed legislative and presidential elections. That process was supposed to be concluded next month but was pushed back again last week.
Roble has accused Mohamed of "obstructing effective investigation" of the case of Ikran Tahlil Farah, an agent of the National Intelligence Service Agency who went missing while working in the agency's cyber security department.
Farah's family has said it believes she was murdered, while the agency has not commented on the case.