Japan's Nikkei closed lower on Thursday as investors booked profits after the index's record high, but it erased most of its early losses on buying demand from the declines.

The Nikkei fell for a second day, falling 0.11 percent to close at 39,166.19 points, after falling as much as 0.8 percent earlier in the session to trade below the 39,000 level for the first time since Feb. 22.

Investors bought back stocks after the Nikkei fell below 39,000, said Shoji Hosoi, chief strategist at Daiwa Securities.

Another notable stock was Toyota, which rose despite the strong yen, showing that investors are still chasing Japan's big companies.

The yen rose against the dollar on Thursday after Bank of Japan board member Hajime Takata said the bank should consider changing its ultra-easy monetary policy.

Toyota shares erased early losses to close 1.43 percent higher, becoming the biggest supporter of the broader Topix index's reversal, closing 0.03 percent higher at 2,675.73.

Tokyo Electron, a chip-making equipment maker, also reversed early losses to close up 1.04 percent.

Sentiment was hurt by the latest data from the Ministry of Finance showing foreign investors became net sellers of Japanese stocks over the course of a week, said Ryutaro Sawada, senior market analyst at Tokai Tokyo Research Institute.

Foreign investors sold 200 billion yen ($1.33 billion) worth of Japanese stocks in the week to Feb. 24, ending a seven-week buying spree.

(1 dollar = 150.0000 yen)