The Edinburgh-based agency, part of WPP, originally won the business from Aegis-owned Feather Brooksbank in August 2004.
It then repitched for the account this summer against a number of agencies, including Spirit Media, MediaVision, Feather Brooksbank and BZO, a joint venture between Barkers and ZenithOptimedia.
Feather Brooksbank beat four other agencies to win the media account in 2001.
Under the deal, MediaCom Scotland will continue to handle media for a range of Scottish public organisations, including the Scottish Parliament, VisitScotland, NHS Health, Quality Meat Scotland and Historic Scotland.
The current three-year contract has been shortened to 16 months. It will run from 3 December, with two one-year optional extensions, possibly until March 2011.
Scottish Executive's head of marketing, Roger Williams, said: "We want to bring it in line with the financial year, which runs up to the end of March, with options to extend."
The Scottish government has set a media spend ceiling of £60m for all of the public organisations involved over the course of the potential three years and four months of the contract, he added. The contract should have been finalised in July, but was extended with MediaCom until December due to the "weight of work" in the pipeline, Williams added.
MediaCom Scotland's managing director Euan Jarvie said there was currently a huge focus on Scottish marketing expenditure.
He said: "In three-and-a-half years we have done more award-winning work for the Scottish Executive than any agency before."
MediaCom Scotland handles media for a range of regional and national clients, including Baxters Food Group, Royal Bank of Scotland, Standard Life and tourist board VisitScotland.
The Scottish Executive, established in 1999, is the devolved government for Scotland, responsible for various day-to-day issues.
It managed an annual budget of £27bn in the financial year 2005-2006, which is due to rise to more than £30bn in 2007-2008.
The Scottish Executive also plans to put its creative, PR and online agencies out to pitch in January, with the aim of bringing those contracts in line with the latest media deal to end in March 2011.