Holding banners and chanting "Muslims are brothers. A Muslim does not kill his brother" and "Yes to freedom, No to terrorism and barbarity", the protesters on Sunday marched through Casablanca, a city of six million and Morocco's financial capital.
Al-Qaida has said it decided to kill the Moroccan embassy employees, Abderrahim Boualem and Abdelkrim al Mouhafidi, because of Morocco's support for the US-backed Iraqi government.
Top Moroccan officials, ministers, pro-government and opposition party leaders, and trade unions and rights groups led the protest to put pressure on al-Qaida to free the two men.
Some members of Islamist parties that back Iraqi fighters battling US-led forces in Iraq also joined the march.
"All Moroccans are with Iraq, all Moroccans are innocent," the marchers chanted.
Morocco's influential organisation of Islamic scholars, known as the High Council of the Ulema and the Councils of Ulema in the Moroccan Kingdom, dismissed al-Qaida's argument that its verdict to kill the two embassy employees was "God's judgment".
"The two Moroccans would be considered martyrs if this iniquitous verdict were to be carried out, as they were carrying out a duty assigned to them by their nation and legitimate state," the Moroccan Islamic body said on Saturday.
Organisers and government officials said more than 150,000 people took part in the peaceful march, but reporters said the anti-Qaida protesters numbered more than 10,000.