The move threatens an already fragile peace deal in a country ravaged by civil war.
President Salva Kiir installed a new first vice president, Taban Deng Gai, who had been mining minister in a coalition government formed in April. Taban also acted as the rebels' chief negotiator during peace talks.
The appointment raises fears of more fighting because most opposition generals and militia remain loyal to Machar.
A faction of the armed opposition on Saturday selected Taban to replace Machar, claiming that the coalition government could not function with Machar in hiding.
Also Read
But loyalists to Machar are alleging a conspiracy to remove him. Nyarji Roman, a spokesman for Machar's faction, called the appointment of Taban "totally illegal."
Kiir, who had invited Machar to return to the capital, Juba, on Tuesday denied having a role in his ouster.
"Circles will take it that it is me in person ... Who has really conspired for the removal of Dr Riek Machar. It is not me," Kiir said after the ceremony.
Roman also accused the government of sending troops to hunt down Machar in his hiding place. Machar has said he would not return to Juba until an outside force, such as an intervention force proposed by the African Union, was put in place to restore calm to the capital.