He reportedly played Perfect to her on an acoustic guitar before his third album came out in March and she fell in love with the song.
It surely won't be long before speculation mounts that the king and queen of pop would be Perfect as wedding singers at the reception of Prince Harry and Meghan Markle next year.
"It's something I kinda did just to see whether she would say yes," he told News Corp Australia on Friday.
"I just wanted to see what would happen. I can't believe it, to be honest."
Sheeran revealed the pair finished recording the reworked version in a New York studio, with only themselves and an engineer privy to the session.
He said even he was shocked that they managed to work one-on-one on the song rather than having a crowded studio full of advisers wanting to weigh in on the recording.
"It's a really weird thing, it was just me and her and an engineer, which was very cool," he said.
"To be on-on-one with someone you respect that much and be able to craft the song the way you envision without input from anybody else ... that's rare.
"When there are two people coming together like that, everyone has an opinion, you know."
After the session, Beyonce went on a date night with husband Jay-Z and Sheeran went for drinks with his closest mates but couldn't tell them anything about the secret collaboration.
Beyonce has been busy working with other artists since welcoming her twins, Sir and Remi, in June.
She appeared on a remix of Mi Gente, the Latin smash by J. Balvin and Willy Williams, to raise funds for the hurricane relief efforts in Puerto Rico and the Caribbean.
And she recently featured on the new Eminem single Walk on Water which was released a few weeks ago.
Sheeran will return to Australia for his massive stadium tour in March.
He has made no promises to not ride bicycles before his trip Down Under despite having to halt the world tour in October after both arms were broken when he was hit by a car while cycling in London.