The shootout killed nine people plus three attackers, in a rare attack far from the jihadists' northern strongholds, Mali's defense ministry adviser said.
The four rescued U.N. employees were two South Africans, a Russian and Ukraine, said U.N. mission in Mali spokeswoman Radhia Achouri.
"Our contractors survived because at no time was their presence discovered by the terrorists in the hotel," she said adding there was not much resistance Saturday morning during the rescue. The four will soon go to Bamako, the capital, she said.
Additional U.N. personnel may still be missing, said a U.N. official not authorized to speak to the press on the matter. Some personnel could not be reached, and some of the attackers left Sevare after the initial attacks Friday morning, the official said.
Islamic extremists started the attack Friday at the Hotel Byblos in Sevare, about 600 kilometers (375 miles) northeast of Bamako.
Mali's army surrounded the hotel and fighting went into the night Friday. Mali's special forces were transported to Sevare from Bamako early Saturday and launched an operation to rescue the people inside the hotel. It is unclear how many fighters were involved.
After the operation four additional bodies were found in the hotel, including three hotel staff and one jihadi, said Lt. Col. Diarran Kone. Officials had earlier announced that five Malian soldiers were killed, two jihadis and a U.N. contractor, bringing the total death toll to 12.
"The operation ended around 5 a.m.," he said. "The operation was led by Mali's gendarmerie with our partners."
The government said Friday that forces detained seven suspected militants.
Northern Mali fell under the control of jihadis in 2012 but a French-led offensive ousted them in early 2013. Remnants of the extremists have staged attacks on U.N. peacekeepers and Malian forces, but Friday's assault on a hotel popular with U.N. pilots marks a serious escalation.
Sevare and the nearby town of Mopti in central Mali have long been the heart of Mali's tourism industry and had been spared the attacks more common in the northern towns of Gao and Timbuktu. Mali's jihadi groups have been stepping up their attacks further south from their strongholds in the north.