The crowd in Rabat of about 10,000 people denounced what protest leaders called a "war of extermination" as well as the normalisation of relations between Morocco and Israel.
The protesters were called to the streets by a disparate group of organisations backing the Palestinian cause, including left-wingers and members the Islamist Justice and Charity movement.
In 2020, Morocco joined a number of Arab countries in establishing diplomatic and trade relations with Israel under the US-brokered Abraham Accords.
As part of the deal, Rabat received US recognition for its claim to sovereignty over the disputed territory of Western Sahara.
On Mohammed V avenue, numerous protesters wielded banners condemning the "destruction of hospitals" in Gaza and Israeli settlements in the occupied West Bank.
Posters called for "free Palestine" and to "save Gaza".
The crowd chanted slogans lauding the "resistance of the Palestinian people" and directed particular fury at the United States for its support of Israel's war against Hamas.
"When you bomb massively without distinction between military targets and civilians, including babies - that is a genocide. We must call a spade a spade," said Jihane, a 27-year-old protester.
The war in Gaza was sparked by the unprecedented October 7 attack by Hamas militants against southern Israel.
The militants killed around 1,140 people, mostly civilians, according to an AFP tally using Israeli figures. Hamas also took about 250 hostages, 129 of whom remain in Gaza according to Israel.
Israel responded with a massive retaliatory air and ground offensive on the Gaza Strip, aimed at destroying Hamas. That campaign has killed more than 20,400 people, mostly women and children, according to the health ministry in the Hamas-run territory.
In Rabat, Hachimi Damni, a 62-year-old protester, said he had come to express his opposition to the bombing in Gaza and normalisation with Israel.
Public expressions of opposition to the Abraham Accords had been rare before the war in Gaza.
Yet it is now a regular feature of the multiple large protests that have swept Morocco since October 7, with demonstrators on Sunday chanting that normalisation had been "treason".
The North African kingdom has officially denounced what it said was "the flagrant violations of the provisions of international law" by Israel in its war against Hamas, but has not given any indication that normalisation with Israel would be undone.