The announcement came a day after the two men sparred over the country's sluggish preparations for elections, with Roble accusing President Mohamed Abdullahi Mohamed, who is better known as Farmajo, of sabotaging the polls.
Relations between Farmajo and Roble have long been frosty, but the latest development raises fears for Somalia's stability as it struggles to stage elections and fight a jihadist insurgency.
On Monday, Farmajo's office said the president had "decided to suspend Prime Minister Mohamed Hussein Roble and stop his powers since he was linked with corruption", accusing him of interfering with a probe into a land-grabbing case.
But Roble hit back, accusing Farmajo of attempting "to take over the office of the prime minister by force (in) a move violating the constitution and the law of the country".
"The prime minister... is committed to not being deterred by anyone in fulfilling his national duties in order to lead the country to elections that pave the way for peaceful power transfer," said the statement released by Roble's office.
Despite a heightened military presence around the prime minister's office, Roble was still able to enter the premises, a day after Farmajo withdrew his mandate to organise the elections and called for the creation of a new committee to "correct" the shortcomings.
The two men have traded accusations in recent days, with Roble alleging that Farmajo did not want to hold "a credible election".
Farmajo in turn has accused Roble of trying to influence a probe into a scandal involving army-owned land after the premier sacked the defence minister and replaced him on Sunday.
"The prime minister has pressurised the minister of defence to divert the investigations of the case relating to the grabbed public land," Monday's statement by Farmajo's office said.