The Interior Ministry said Suleiman bin Abdullah had been found guilty of kidnapping a male child, tying him up "and performing the obscene" act.
Authorities carried out the sentence against him in Buraydah city, northwest of Riyadh, the ministry said in a statement carried by the official Saudi Press Agency.
He was the latest of 84 Saudis and foreigners to be executed in the kingdom this year, according to an AFP tally.
Rape, murder, drug trafficking, apostasy and armed robbery are punishable by death under Saudi Arabia's strict version of Islamic Sharia law.
