Meta Platforms reported a strong rise in advertising revenue, beating Wall Street expectations for the second quarter, and the company also provided a better forecast for its revenue in the next quarter.

The Meta results, Facebook's parent company, come a day after search engine owner Google Alphabet Inc's strong performance, proving that eager consumers and advertisers are spending despite broad economic concerns.

However, Meta also expects expenses to rise in both 2023 and 2024, citing costs including legal fees and increased infrastructure spending that are key to the AI frenzy in the technology sector.

The spending follows significant cost cuts in other areas of the company, including safety teams and core business functions.

Meta shares rose 7.5 percent in after-hours trading.