Al-Qadhafi also threatened fresh attacks on Italians if Libya's historical claim for damages for decades of Italian colonisation went unheeded.
The comments in a televised speech on Thursday mark a new low in relations between Italy and its former African colony.
Libya's official news agency, JANA, quoted al-Qadhafi as telling the People's General Congress - the closest thing Libya has to a parliament - on Thursday night that the rioters were venting their hatred for Italy rather than protesting against the cartoons about the Prophet Muhammad, as has been widely reported.
Elements of a crowd of about 1000 demonstrators broke into the grounds of the Italian consulate on 17 February and set fire to vehicles and part of the building.
Police struggled to contain the riot, which lasted six hours, and shot dead 11 people. Thirty-five people were wounded, but no Italians were harmed.
The crowd appeared to be reacting to an Italian cabinet minister who publicly supported the Danish publication of caricatures of Muhammad, which had provoked protests across the Muslim world.
The minister, Roberto Calderoli, was forced to resign by Silvio Berlusconi, the Italian prime minister, who has sought closer ties with oil-and-gas rich Libya since his election in 2001.
Italian diplomats said later there was an anti-Qadhafi factor in the protest.
The 17 February attack on Italy's
Benghazi consulate left 11 dead
"Libyans do not know Denmark, they do not hate Denmark. They know Italy and they hate Italy," al-Qadhafi told the congress, according to a report on Jana's website on Friday.
"People would have killed the consul and his family if live ammunition had not been used," al-Qadhafi said.
"They said: So what if the consul and his family are killed. Italy killed some 700,000 Libyans," al-Qadhafi said of the rioters, referring to the Italian colonisation of Libya in 1911-1943.
It was the first time that al-Qadhafi's government had blamed the riots on the Italian colonial period.
There was no immediate response from the Italian government.
The Italian Foreign Ministry was reported to be awaiting a full translation of his speech, broadcast on state television.
But Piero Fassino - leader of the country's biggest opposition party - described the speech as "disconcerting".
"I don't believe we can encourage reciprocal understanding and solutions to our problems with threats"
Democrats of the Left leader
"It certainly doesn't encourage better relations between Italy and Libya," he added.
"I don't believe we can encourage reciprocal understanding and solutions to our problems with threats," said the Democrats of the Left leader.
"I would hope that they are incidental opinions and that otherwise the Libyan authorities are open to discuss in a peaceful and serene way all problems of reciprocal interest with Italy," Fassino said.