A logistical convoy of the UN peacekeeping mission travelling between the towns of Tessalit and Gao was attacked on Saturday evening by "unidentified armed individuals" who killed two of the soldiers, the mission, known as MINUSMA, said in a statement.
It did not indicate the nationalities of those killed.
The convoy had stopped when it was attacked near the village of Tarkint, northeast of Gao, the largest town in northern Mali.
The UN troops "retaliated firmly and sent the assailants fleeing", the statement said.
Read also: Egyptian peacekeeper killed in Mali attack
The head of the peacekeeping mission, Mahamat Saleh Annadif, condemned the "cowardly acts aimed at paralysing the mission's operations on the ground".
"We will have to work together to identify and apprehend those responsible for these terrorist acts so that they can be held accountable for their crimes before the courts," the statement quoted him as saying.
The MINUSMA has some 13,000 troops drawn from several nations deployed across the vast semi-arid country.
Mali is struggling to contain an Islamist insurgency that erupted in 2012 and which has claimed thousands of military and civilian lives since.
Despite the presence of thousands of French and UN troops, the conflict has engulfed the centre of the country and spread to neighbouring Burkina Faso and Niger to the west.
Follow us on Facebook, Twitter and Instagram to stay connected