Thousands of demonstrators clad in black flooded a square in the centre of the Malaysian capital of Kuala Lumpur to protest at increases in petrol and other prices, putting pressure on a government struggling to reduce debt.

Demonstrators gathered at the Independence Square in defiance of police warnings not to rally and caused a New Year Eve's performance held there by the city to be cut short.

The protest ended peacefully after midnight and organisers said some 15,000 people attended the rally, while police put the number at 5,000.

"Today is a signal. We hope the government realises that the people are angry and can listen to our demands - reduce the cost of living for the people," Bukhairy Sofian, chairman of youth group Student Solidarity Movement Malaysia, said after giving a speech together with other activists and opposition politicians.

"There is too much corruption," he said, adding there could be more protests.

Prime Minister Najib Razak, whose Barisan Nasional (National Front) coalition won last year's elections with its worst showing yet in its 55-year rule, has been struggling to reduce the debt of Southeast Asia's third largest economy.

In his New Year message, Mr Najib said cutting subsidies of essentials, such as petrol and sugar, which cost the government billions of dollars, and raising other prices were "necessary".

"We must accept that we have to make changes to keep our finances under control," he said, adding low-income earners would continue to receive handouts to help them.

Petrol prices rose 10.5 per cent when the government cut fuel subsidies for the first time since 2010 in September, while electricity tariffs have been increased by some 15 per cent.

Malaysia has one of Asia's highest debt-to-GDP ratios, and Fitch ratings agency in July warned the country to get its financial house in order or face a possible sovereign-debt downgrade.

Critics of the country say the government has failed in its pledge to fight endemic corruption.

Authorities had urged people not to gather, alleging protesters would cause unrest, but hundreds of police on stand-by allowed them to rally.

A 2012 electoral reform demonstration at the square ended in violence when protesters broke through a barricade and police retaliated with tear gas, water cannon and mass arrests.

"The government earns a lot. There are many things that they can do to take care of the people. But the cost of living is getting higher and higher," said Shafiq Baik, 23, who earns about $240 a month selling chicken rice.