Thomas Haggerty, 30, was stopped by police after a tip-off.
At the High Court in Glasgow, he admitted being concerned in the supply of the drug in July last year.
He will be sentenced on 29 June at the High Court in Edinburgh but was allowed bail to support his partner whose father had died suddenly.
The court heard how a search of Haggerty's car at Lockerbie police station revealed two blue packages each containing a kilo of cocaine.
Police also obtained a warrant to search his home later that day, but found nothing incriminating.
In court, Haggerty admitted the offence one mile south of junction 17 Lockerbie.
Advocate depute Stewart Ronnie, prosecuting, said: "About 1.40pm on 28 July, last year, the accused was seen by police driving in the northbound lane of the A74(M).
"Police had intelligence that he was carrying drugs and he was detained.
"He and his car were taken to Lockerbie police station and searched."
The court was told that police drugs experts who examined the cocaine found it to be 59% pure. At the time street cocaine was 15% pure.
Mr Ronnie added: "They are of the opinion that if the cocaine was adulterated to 15% and sold in one gram deals it would realise £312,000."
Defence counsel Tony Graham asked for bail, explaining that Haggerty would like to be able to support his partner.
Mr Graham added: "This is not a man who profited from drugs and nothing incriminating was found in his home.
"He has admitted a single day's supply couriering the drug."
Lord Boyd told Haggerty that he needed background reports before passing sentence.
"It would be unusual at this stage that you should be allowed bail, but I am prepared to admit you to bail," he said.
A court has heard how a taxi driver from Renfrew was caught with a cocaine haul with a street value of more than £300,000 on the A74(M) near Lockerbie.