LIMA, Peru (AP) _ A Peruvian air force plane evacuating people stranded by floods crashed into a shantytown in the northern city of Piura on Sunday.

Twelve people were killed and 39 injured, said Dr. Luis Bergolea, director of a local hospital. The Russian-made plane was believed to be carrying at least 50 people.

The plane was evacuating people stranded by El Nino-driven flooding from the city of Tumbes near the Ecuadorean border to Piura, 530 miles northwest of Lima, when it went down one mile from Piura airport.

Authorities say the plane was preparing to land when one engine broke down. The pilot apparently tried to avoid landing in the shantytown and crashed the plane into a drainage ditch.

The plane split into two pieces but did not explode, witnesses said.

Two houses were damaged, but no one was killed on the ground, local radio station RadioProgramas reported.