Japanese stocks ended higher Tuesday for a tenth straight session, thanks to a stronger dollar and despite concerns about the weekend attack on Saudi oil facilities.
The benchmark Nikkei 225 index added 0.06% to 22 001.32, while the broader Topix index rose 0.29% to 1 614.58.
Rising oil prices boosted energy shares, but consumers of oil, such as airlines, faced selling pressure.
Renewed tension in the Middle East led the Tokyo market to start in the red, as global investors fretted over the attack in Saudi Arabia that triggered oil prices to soar.
The incident prompted US President Donald Trump to suggest that Iran might be behind the attack and that Washington stood ready to stage a counter-attack but adding the US wished to avoid violence.
Traders were given a weak lead from Wall Street with the Dow ending 0.5% lower.
"The dollar rose against the yen and encouraged dip-buying. It lifted the Nikkei index to the ¥22 000 level," Okasan Online Securities said in a commentary.
"But profit-taking was also seen at the top end of the range, meaning the Nikkei plateaued in the afternoon," it said.
The dollar was up at ¥108.22, from ¥108.10 in New York.
Oil explorer Inpex soared 9.71% to ¥1 102 while Japan Petroleum Exploration roared 7.89% to ¥2 981.
Mitsubishi UFJ Financial Group added 0.74% to ¥571.7, Nintendo rose 0.70% to 41 890 and Toyota added 0.66% to 7 445.
But among airlines ANA Holdings lost 1.45% to 3 733 and Japan Airlines fell 1.88% to ¥3 390.
Tech investor SoftBank Group dropped 3.04% to ¥4 690, while construction equipment maker Komatsu fell 0.12% to ¥2 515.5.