"Miroslav Tomic, 46, employed by German firm Ferrostaal and kidnapped on Sunday afternoon... was freed today," a ministry statement said citing the Serbian embassy in Tripoli, without giving details about the kidnappers.
Tomic was "safe and is to return to work on Thursday," the statement added.
Serbian media had earlier said that Tomic was kidnapped on Saturday while visiting an oil well in a remote area near the Egyptian border.
The abduction came two months after the deaths of two kidnapped Serbian embassy employees in Libya.
Embassy communications chief Sladjana Stankovic and her driver Jovica Stepic were kidnapped in November in the coastal city of Sabratha, 70 kilometres west of Tripoli, from a convoy of cars heading to the Tunisian border.
The pair were killed by a US strike on an Islamic State jihadist camp in February, the Serbian government said, and their bodies were returned to Serbia - although the Pentagon disputed claims they were killed by the strike.
Libya descended into chaos after the October 2011 ouster and killing of longtime dictator Muammar Gaddafi, and has become a magnet for militants who receive weapons training in jihadist camps before launching deadly attacks in other countries.
Serbian citizens - mostly doctors, other medical staff and construction workers - have been working in Libya for decades due to close relations during Gaddafi’s regime.