Police have arrested about 40 activists demonstrating in Azerbaijan's capital Baku against President Ilham Aliyev's government, and in support of residents of a northern town were protests were crushed earlier this week.

More than 100 protesters gathered in central Baku on Saturday, some chanting "Freedom!" and calling for the resignation of Aliyev.

Police swiftly stopped the protest, forcing demonstrators out of a park and then arresting some in the street.

The protest was triggered by unrest in Ismailli, about 200km northwest of Baku, where police used teargas and water cannon on Thursday to disperse hundreds of protesters demanding the resignation of a regional leader.

Cars were torched and a hotel set ablaze in a night of rioting.

Unrest in Ismailli reflected frustration at what some Azeris see as an overbearing government, corruption and a large divide between rich and poor in the mostly Muslim Caspian Sea nation of nine million where many lack jobs, money and prospects.

Aliyev succeeded his father in 2003 and has tolerated little dissent in the oil-producing former Soviet republic.

"Our patience came to an end. People are very unhappy with this regime. We demand a change of power in our country," demonstrator Malakhat Nasibova said at the protest in Baku.