The attack Tuesday took place about 60 kilometres from the town of Obo, as the troops were escorting a convoy of fuel trucks sent from Zemio, MINUSCA said.
"Two peacekeepers died and two others were injured," it said. "The attackers fled into the bush."
The United Nations Security Council yesterday condemned the attack "in the strongest possible terms."
"The members of the Security Council expressed their deepest condolences and sympathy to the families of the peacekeepers killed, to the Government of Morocco and to MINUSCA and extended their sympathies to the government of the Central African Republic," the UNSC said in a statement.
More From This Section
Landlocked and chronically poor, the Central African Republic is struggling to emerge from a civil war that erupted in 2013 following the overthrow of former president Francois Bozize, a Christian, by Muslim rebels from the Seleka coalition.
The 12,500-strong MINUSCA peacekeeping mission was deployed in December that year under the aegis of the African Union and with the support of France, the former colonial power.
The notorious Ugandan group, the Lord's Resistance Army, has been operating in the Obo region for several years.