U2 may be giving a new album away, but it is still getting paid.

As part of what Timothy D. Cook, Apple’s chief executive, called “the largest album release of all time,” the company released U2’s new “Songs of Innocence” free through iTunes on Tuesday, just after the band performed a new song, “The Miracle (Of Joey Ramone),” at the close of Apple’s product announcement event in Cupertino, Calif.

For what Apple said were up to 500 million customers in 119 countries, “Songs of Innocence” simply appeared in their iTunes accounts on Tuesday afternoon. But the deal that led to that release was carefully negotiated between U2 and some of the most powerful entities in music, including Apple; Universal, the band’s label; and Guy Oseary, U2’s new manager. Mr. Oseary works in the management division of Live Nation Entertainment, the global concert conglomerate.

To release U2’s album free, Apple paid the band and Universal an unspecified fee as a blanket royalty and committed to a marketing campaign for the band worth up to $100 million, according to several people briefed on the deal. That marketing will include a global television campaign, the first piece of which was a commercial that was shown during the event.

Bono, U2’s lead singer, alluded to the deal himself at Apple’s event. After the band performed, he and Mr. Cook playfully negotiated over how the album could be released through iTunes “in five seconds.” Mr. Cook said it could if the album was given away free.