Hunters shot and killed a brown bear in northern Japan after it rampaged through a city, injuring four people including a soldier and lumbering across busy roads.

The city of Sapporo tweeted that the bear had been "exterminated," with a local television station saying hunters had shot the bear.

Earlier, dramatic news footage showed the bear bounding along a residential street, crossing a busy road and clawing at the gates of a military barracks, causing alarmed troops to scatter.

One soldier was injured in the bear's rampage in the city, which will host the Olympic marathon and racewalking events in August.

Another victim was mauled by the bear after it attacked him from behind, TV footage showed. The person was taken away on a stretcher.

The rampage prompted local school closures and the cancellation of several flights at a small regional airport, NHK reported.

Earlier, government spokesman Katsunobu Kato told people in the Hokkaido region to be on alert.

"A total of four people, including one Self-Defense Forces member, have been attacked and injured by the brown bear. We express our sincere sympathy to them," he said.

"Officials from Sapporo City, the Hokkaido police, a local hunting association and other concerned agencies have arrived at the scene. They are coordinating efforts to capture the brown bear, or if deemed necessary, exterminate it."

Police officers and members of a hunting group search for the bear in Sapporo

One of the victims was in their 40s, one in their 70s and another in their 80s, according to NHK, which did not give details of the fourth.

Asian black bears are native to large parts of Japan, including the country's main island, while brown bears roam Hokkaido further north.

The Japan Bear and Forest Society has warned that forest-dwelling bears are being spotted in greater numbers in areas inhabited by humans as they search for food.