on the unrest which has rocked Hong Kong for months.
His comments came during a joint press conference with German Chancellor Angela Merkel in Beijing.
Hong Kong has seen months of often-violent protests calling for democracy and less influence from China.
The protests were sparked by changes to a law that would allow extradition to mainland China, but have since widened to include calls for an independent inquiry into police brutality and demands for greater democracy.
On Wednesday, embattled Chief Executive Carrie Lam withdrew the controversial extradition bill but that has failed to appease the activists.
More protests are expected this weekend, with activists threatening to disrupt transport links to the airport.
What did the Chinese premier say?
In August, China had likened to protests to terrorism, warning activists not to "underestimate the firm resolve" of the Beijing government.
Li Keqiang, China's second highest-ranking leader, told reporters on Friday: "The Chinese government unswervingly safeguards 'one country, two systems' and 'Hong Kong people govern Hong Kong people'."
He said China backed Hong Kong "to end the violence and chaos in accordance with the law, to return to order, which is to safeguard Hong Kong's long-term prosperity and stability".
Why closed stores caused trouble in China for Zara
Seven ways China's media took on HK protests
What led to a single gunshot being fired?
He said the world "needs to believe that the Chinese people have the ability and wisdom to handle their own matters well".
Merkel calls for dialogue
German Chancellor Angela Merkel said a peaceful solution was needed for Hong Kong, urging that "in the current situation, violence must be prevented".
She said there were signs Ms Lam would invite the necessary dialogue.
"I hope that materialises and that demonstrators have the chance to participate within the frame of citizens' rights."
She also stressed that the "rights and freedoms" for the people of Hong Kong "have to be granted".