Video game publisher Electronic Arts Inc, reported a narrower-than-expected loss and raised its second-quarter earnings forecast, as it sold more copies of the puzzle game "Portal 2" than expected and made more money on digital games.

EA, which has been ramping up digital games that can be played on smartphones and tablets, said on Tuesday its adjusted revenue fell 3 percent to $524 million, above the average analyst estimate of $511 million.

The company's revenue was lower than last year when it released a World Cup-themed soccer game.

EA's revenue in the quarter was boosted by the sale of digital games, which helped the company beat estimates, said Eric Brown, the company's finance chief, in an interview.

"Because the other areas of our business, specifically digital, were growing so quickly, we were able to come in at revenue that was only down 3 percent overall," Brown said.

EA also sold 2 million units of "Portal 2," a game it distributes for the company Valve. The game features robotic characters and puzzles, and can be played on consoles and on PCs.

EA, best known for selling its "FIFA" and "Madden" sports titles, expects a second-quarter loss of 13 cents to 3 cents a share, roughly in line with analysts' estimates.

For the three months ended June 30, profit rose to $221 million, or 66 cents per share.

Excluding deferred revenue, the company reported a loss of $123 million, or 37 cents per share, compared with a loss of $78 million, or 24 cents a share, a year earlier.

Analysts on average were expecting a loss of 39 cents a share, according to Thomson Reuters I/B/E/S.

The company's digital revenue, which comes partly from games that are played on the Internet, rose 11 percent to $209 million.

EA shares were flat in after-hours trading on Nasdaq.