Aqeel Khan Mohammed Riyad was convicted of attempting to smuggle heroin into the ultra-conservative Muslim kingdom, the ministry said in a statement carried by state news agency SPA.
He was beheaded in the capital.
His execution brings to 15 the number of people beheaded in Saudi Arabia so far this year.
In 2012, the kingdom executed 76 people, according to an AFP tally based on official figures. The US-based Human Rights Watch put the number at 69.
Rape, murder, apostasy, armed robbery and drug trafficking are all punishable by death under Saudi Arabia’s strict version of sharia, or Islamic law.