Kevin McConville, 33, was stopped by officers on the A1 carriageway, near Dunbar, East Lothian, on December 15, 2011, and almost a kilo of the drug was found along with a further quarter kilo of a mixing agent.
A house search then discovered more than another three kilos of cocaine along with a quantity of benzocaine used to cut the drug.
McConville earlier admitted being concerned in the supply of the Class A drug at his home in Stanley, County Durham, and on the A1.
Lord Pentland told him at the High Court in Edinburgh: “You have pled guilty to a serious offence.
“This court has repeatedly made it clear that those who choose for whatever reason to become involved in the pernicious trade in dangerous drugs must expect to receive sentences of imprisonment.”
The judge said he acknowledged that McConville had no significant previous convictions, but had accepted responsibility as a custodian and courier for the drugs.
He told McConville that he would have faced a six year jail sentence, but for his guilty plea.
Defence counsel Susan Duff said painter and decorator McConville had been put under “considerable pressure” to take part.