Tens of thousands of protesters have rallied outside Japan's parliament to oppose legislation that could see troops in the officially pacifist nation engage in combat for the first time since World War II.

In one of the summer's biggest protests ahead of the new law's anticipated passage next month, protesters on Sunday chanted "No to war legislation!" ''Scrap the bills now!" and "Abe, quit!"

Organisers said about 120,000 people took part in the rally in the government district of Tokyo, filling the street outside the front gate of the parliament, or Diet. Similar demonstrations were held across the nation.

The law would expand Japan's military role under a reinterpretation of the country's war-renouncing constitution.

In July, the more powerful lower house passed the bills that allow the army, or Self-Defense Forces, to engage in combat when allies come under attack even when Japan itself is not.

The upper house is currently debating the bills and is expected to pass them by late September, making it law.

Prime Minister Shinzo Abe and his supporters say the bills are necessary for Japan to deal with the changed security environment in the world.

Public polls showing the majority of people oppose the bills and support for Abe's government is declining.

"In order to make the world a better place, where the life of even a single child is taken away, we must take action now or Japan will make a turn for the worse. That's why I came today," Mami Tanaka, 35, who joined the rally with her husband and their three children, told the Reuters news agency.

Activists posted the following footage from the protest: