Ahmed al-Gizawi was accused of trying to smuggle 21,380 capsules of the anti-anxiety drug Xanax, which is banned in Saudi Arabia where drug trafficking carries the death sentence.
Another Egyptian arrested in the same case was sentenced to four years in prison and 400 lashes, while their Saudi partner was jailed for two years and will receive 100 lashes.
The lashes are implemented at the rate of 50 per month.
"These verdicts are lenient" given the defendants' "good morals ... and the lack of judicial precedents," the judge said at the hearing. The verdicts can be appealed within one month.
Cleanly shaved and dressed in a crisp white tracksuit, the lawyer murmured "I rely on God" under his breath as the judge read the verdict.
The judge then asked three men, one after the other, if they accepted the ruling and they all replied negatively.
The prosecution, which alleged that Gizawi had hidden the banned substance in two milk cartons and a cover for the Koran, had demanded the death penalty for the lawyer.
Gizawi had travelled in April to Saudi Arabia with his wife to perform the umra, the minor pilgrimage to Islam's holiest sites in Mecca and Medina, when he was detained at Jeddah airport, the Arabic Network for Human Rights Information said at the time.
The Egyptian organisation said that Gizawi was held after he had earlier been sentenced in absentia to one year in prison and 20 lashes for criticising the Saudi government.
Gizawi was being targeted for his activism over Egyptian detainees in Saudi prisons, it said.
Hundreds of Egyptian protesters had rallied outside Riyadh's embassy in Cairo demanding his release, prompting the kingdom to shut down its mission.
The embassy reopened on May 4 following a fence-mending visit to King Abdullah by a large delegation of prominent Egyptian figures.