The company said its positive earnings were down to its fee-collecting services such as HotJobs, as well as cost-cutting measures.
Yahoo! posted a net loss of $48.5m (£31.4m) for the same period last year, and net income losses for the previous five quarters.
Quarterly net revenue came in at $225.8m (£146m), a 24% increase over the $182.2m (£118m) reported in the second quarter of last year.
Despite a 4% decline in advertising revenue, the company said an increase in electronic commerce transactions and its decision to begin collecting fees for such services as Yahoo! Personals and other listing services created the turnaround. Transactions revenues totalled $16m (£10.4m) for the quarter, a 179% increase compared with the same period last year.
Fees, listings and transactions generated 40% of Yahoo!'s quarterly revenue, chairman and chief executive officer Terry Semel said in a conference call on the company's Web site.
According to Semel, Yahoo! had one million paying customers at the end of the second quarter, up from 600,000 at the end of the first quarter.
Revenue from its non-US operations increased by 16%, or $38.3m (£24.7m), over the same period last year, and comprised 17% of the company's total revenue. US revenue for the quarter was $187.5m (£121.7m), a 26% increase compared with the same period last year.
Yahoo! expects revenue for the third quarter of 2002 to be between $225m (£146m) and $250m (£162m), although it may also face further cost-cutting.