At least 22 people were killed during a weekend attack by gunmen on a Central African Republic hospital, a peacekeeper has said.

Three staff members of medical charity Doctors Without Borders (Médecins Sans Frontières or MSF) were among those killed.

An officer from the African-led MISCA force said armed men from the ex-Seleka rebel group and of Fula ethnicity were responsible for Saturday afternoon's attack in the Nanga Boguila region.

Dozens more were said to have been injured in the attack.

MSF confirmed the death of its three employees in the attack in the northwest of the country, without giving further details.

"The attack happened while local representatives and MSF employees were holding a meeting," an officer said.

"The assailants first opened fire at a group of people, gunning down four of them. Then they went to the hospital where they killed 15 other people and three members of MSF.

"They took computers and several other assets, breaking down doors probably in search for cash," added the officer.

The impoverished country plunged into a crisis after a coup by the mostly Muslim Seleka rebels in March last year.