A masked man has attacked a school in southern Sweden, wounding at least four students before being shot by police.

Students fled the Kronan school in Trollhattan, near Goteborg, Sweden's second-largest city, on Thursday.

In a statement, police in Trollhattan said the attack took place in the school's cafe area and left four students injured. They had no immediate report on the conditions of the attacker or the wounded.

The Swedish TT news agency reported that one person had died, but did not say who it was.

The local Goteborg Tidning daily newspaper said six people - four students, one adult and the perpetrator - were wounded in the attack.

A live feed on the paper's website showed people standing outside a red-brick building with police cars and ambulances parked outside.

The school has 400 students, ranging from pre-school to high school.