Two people, including a 12-year-old girl, have been killed, and at least 17 other people have been injured following a stabbing attack in the town of Kawasaki outside of Tokyo.

The suspected attacker also died from apparently self-inflicted wounds, according to local media.

The attack occurred during the busy early morning commute as workers headed to their offices and children to school in Kawasaki.

A 39-year-old man and the young girl were killed and the fire department said several other children were also among the 17 others injured.

Emergency workers set up a medical tent to treat the wounded at the scene before transporting them to nearby hospitals.

An official at a local hospital said it had received five people wounded in the attack and that four of them had suffered serious injuries.

Among them were a woman, a man and "three girls who are all six years old".

Prime Minister Shinzo Abe voiced "strong anger" over what he described as a "harrowing" attack.

"It is a very harrowing case. I feel strong anger. I offer my heartfelt condolences to the victims and hope the injured recover quickly," Mr Abe said in a televised reaction, his first since the attack.

How the attack unfolded was not immediately clear, with some initial reports saying it occurred in a park, but subsequent accounts describing it as taking place at a nearby bus stop.

"It is a very harrowing incident," government spokesman Yoshihide Suga told reporters.

Violent crime is extremely rare in Japan, and children often travel to and from schools alone, but there have been a few high-profile attacks.

In 2018, a man was arrested in central Japan after stabbing one person to death and injuring two others aboard a bullet train, an attack that prompted new security measures on the famed rail service.

And in 2016, a man stabbed 19 people to death in a disability centre south of Tokyo in what he described as a mission to rid the world of people with mental illness.