"Thank you to whoever bought my Grammy hat on @eBay for $44,100. Your donation benefits From One Hand To AnOTHER," he wrote.

Turns out, Arby's had the winning bid and so the company tweeted back to Williams, "@Pharrell You're welcome. We're HAPPY to support a great cause & get our hat back. Good luck at the #Oscars tonight!"

"What a pleasant surprise," Williams responded in a tweet. "Thank you @Arbys, our roast beef is now officially well done."