Tens of thousands of protesters have gathered outside Japan's parliament to oppose security legislation in one of this summer's biggest rallies ahead of its anticipated passage next month.

They chanted, "No to war legislation!" ''Scrap the bills now!" and "Abe, quit!" during Sunday's rally.

The demonstrators oppose the legislation that would expand Japan's military role.

Based on a Cabinet decision last year reinterpreting Japan's war-renouncing constitution, the legislation would allow the Self Defense Force to engage in combat for the first time since World War II when allies come under attack even when Japan itself is not.

The parliament is expected to make a decision on the matter by late September.