At least seven people have been killed in a landslide in northern Peru, which has suffered months of widespread flooding and heavy rains.

The victims were in several vehicles waiting for the road to be cleared in Rayampampa in La Libertad department, RPP radio reported.

The worst flooding in Peru in decades has left 62 dead and affected half a million people since December, according to a Civil Defence report.

Hundreds of residents of the capital Lima were trapped by floodwaters on Friday and were unable to leave their homes, with police, armed forces and firefighters struggling to free them.

Rescue workers worked starting in the early morning to install ropes and improvised bridges with wooden planks so victims, including infants and the elderly, could cross rushing streams of water to dry ground.

"The magnitude of the emergency and the number of places (where there are people stranded) are so numerous that sometimes it seems that there are not enough troops, but we are making the effort," said Interior Minister Carlos Basombrio.

Television broadcasters reported several stranded people risked their lives to evacuate their destroyed homes or reach their workplaces.

"We have no place to go. We do not even have clothes," a woman whose house was buried under rocks and mud told Canal N during a live broadcast.

Peru's National Meteorological and Hydrology Service warned of more flooding in Lima until Saturday, with heavy rains aggravated by a coastal El Nino climate system.

The emergency in Lima began on Wednesday, when the Huaycoloro, Rimac, Lurin and Chillon rivers overflowed, flooding and causing serious damage in several parts of the city.