Japanese video game giant Nintendo returned to the black for the quarter ended in June thanks to the success of its new Switch console.

Nintendo recorded an operating profit of $144.95 million (5.13 billion yen) for its fiscal first quarter, compared with a year-ago loss of 24.5 billion yen. Revenue jumped 150 percent to $1.37 billion (154.07 billion yen), the company said Wednesday.

The Kyoto-based company sold 1.97 million Switch consoles in the quarter, taking its total sales to 4.7 million units. Nintendo has been unable to keep up with demand for the hybrid home-portable console, and stores in Japan have been operating lotteries for customers to get the chance to purchase one.

The success of the console, along with that of mobile game Pokemon Go, have helped push Nintendo's stock price up 60 percent over the last year. Its market value exceeded that of Sony Corp. last month. However, Sony stock has also been on a tear — the company has more recently pushed its market capitalization to around $51 billion, compared with $45 billion for Nintendo.

Nintendo is forecasting sales of 10 million Switch consoles for the full fiscal year to March 2018 and operating profit of 65 billion yen ($580 million at current rates).

The company was late to move into mobile gaming, but revenue from titles including Super Mario Run, along with IP licensing, rose 450 percent to $80 million (9 billion yen) for the latest quarter.

Nintendo's stock closed up 1.3 percent at 35,770 yen ($320) in Tokyo before the earnings announcement.