The vote on the constitutional amendment was delayed for several hours as the opposition tried to stop the measure coming into law.
Outside, demonstrators rallied in a last-ditch show of protest.
Many Japanese are attached to the pacifist provisions in the constitution which banned fighting overseas.
The bills have already passed through the government-dominated lower house.
The Japanese government says that the changes in defense policy are vital to meet new military challenges such as those posed from a rising China.
It wanted to hold the vote before a five-day holiday begins on September 19. The governing coalition has a majority in both chambers of the Diet, meaning that ultimately the opposition camp was powerless to stop the measure becoming law.
Masaaki Yamazaki, the president of the upper house, said the bills were passed with 148 lawmakers voting in support and 90 against.
More than 200 hours have been spent deliberating the legislation, the Japan Times reported, and its approval by parliament fulfils one of PM Shinzo Abe’s long-held ambitions.
On September 17, opposition politicians tried to physically delay proceedings ahead of a committee vote on the bills.
The bills prompted large public protests for months.
The changes re-interpret rather than formally change the constitution.
However, critics say this will violate the pacifist constitution and could lead Japan into unnecessary US-led wars abroad.
Speaking in parliament on September 18, Akira Gunji, of the opposition Democratic party, said: “We should not allow such a dangerous government to continue like this.
“Prime Minister Abe’s security bill is a threat to our legal framework.”
Supporters of the measures, which are backed by Washington, insist they are essential for the defense of Japan and its regional allies, and will permit greater involvement in peacekeeping activities around the world.
Critics have focused on what they say is ambiguity in how the principles of the legislation will be interpreted, and the possibility that future governments will interpret them more broadly.
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…