She opened her headline set with Only Girl in the World, performing in front of a giant sphinx.
"Hackney, you're crazier than they told me!" the 24-year-old shouted, as up to 50,000 fans watched.
Her mentor Jay-Z took to the stage for a run of three songs. The pair had also performed together during Jay-Z's set on Saturday night.
After her third track, S&M, Rihanna ran into the audience to ask for help re-attaching the battery pack for her microphone, which had become loose during a high-energy dance routine.
She closed the set an hour later with We Found Love, her global number one hit from last year.
Rihanna review: 'History' in Hackney
"You guys are making this such a memorable show for me," she said before she left the stage.
Earlier on Sunday, Florence and the Machine performed on the main stage, followed by Dizzee Rascal - a surprise addition to the bill.
Dizzee, who grew up in Bow, near the Hackney Marshes venue, paid tribute to "my east London crew".
He recalled his days as a "pirate radio MC" in London before his self-produced single I Luv You landed him a record contract.