Meta Platforms said Wednesday its second-quarter profit declined even as revenue beat Wall Street’s expectations, as legal expenses and severance costs for recent layoffs weighed on its results. The Facebook and Instagram parent company earned $15.85 billion, or $6.18 per share, in the April-June period. That’s down 14% from $18.34 billion, or $7.14 per share, in the same period a year earlier. Revenue grew 28% to $60.8 billion from $47.52 billion.Analysts, on average, were expecting earnings of $7.19 per share on revenue of $60.22 billion, according to a poll by FactSet. “AI is accelerating our core business today, powering our next generation of products, and opening the door to entirely new enterprise opportunities,” said CEO Mark Zuckerberg in a statement. “The results are already showing, and I’m optimistic about the potential ahead.”

Meta said the number of daily active users on its “family of apps” — Facebook, Messenger, Instagram and WhatsApp — grew 3% from a year earlier to $3.6 billion.The Menlo Park, California-based company had 75,472 employees as of June 30, a decrease of 1% year-over-year. This still includes the roughly 8,000 workers the company said it would lay off. Meta said its third-quarter earnings report will have the updated figure. For the current quarter, Meta is forecasting revenue in the range of $61 billion to $64 billion, the midpoint of which is lower than the $63.14 billion that analysts are expecting.