Petrie, who arrived in Myanmar in 2003, had made public remarks that were critical of Myanmar's government and will probably have to leave the country after the decision.
A statement by the UN last month criticised a "deteriorating humanitarian situation" in the country.
The US has denounced the decision to end Petrie's mandate.
"The United States is outraged that the Burmese junta would expel the UN human rights representative," Gordon Johndroe, US national security council spokesman, said, using Myanmar's former name of Burma.
"This kind of treatment is completely unacceptable and is especially inappropriate [before Gambari’s visit]," he said.
Internet access in Myanmar was also cut on Friday in an apparent attempt to limit the flow of information before Gambari's arrival to the country.