The Nikkei climbed 1.98 percent or 167.54 points to 8,626.80 and the Topix index rose 1.78 percent or 12.74 points to 730.48. Among major gainers were Sharp (6.6 percent), TDK (5.9 percent), Mazda Motors (4 percent) and Canon (3 percent).
Market sentiment turned positive after the euro zone finance ministers had agreed to lend 100 billion euros ($125 billion) to Spain to help it overcome the financial crisis. The rising borrowing costs of Spain and its troubled banking system had affected investor confidence negatively in the last few days.
Given the extensive negative sentiment reigning in financial markets due to the mounting euro zone debt crisis, the agreement on the bailout package for Spain came as a respite. The agreement to lend money came after the Eurogroup noted that Spain had already implemented significant fiscal and labor market reforms and measures to strengthen the capital base of the Spanish banks.
Market confidence was also boosted as China reported a set of data, less worrying than most had feared after the rate cut announced last week. Exports rose 15.3 percent in May from a year earlier, which is up from 4.9 percent in April. Also it was reported that consumer price index rose 3.0 percent from a year earlier, which is down from 3.4 percent in April, indicating that price pressures continue to ease.
Though investor sentiment has improved, markets are not completely out of the red as Greek elections, to be held on Sunday, draw closer. This could revive investor concerns on the Greek exit from the euro zone, which, if happens, could significantly disrupt global financial markets.