Think fast!

Katy Perry crouched under her table when she spotted former husband Russell Brand at the Beverly Hills Polo lounge, where she was dining with beau John Mayer Nov. 11.

PHOTOS: Katy Perry through the years

"The hostess almost seated Russell next to Katy," a witness tells Us Weekly. "Katy's face was like, 'Oh, s--t!'"

After the staffer realized her error, she ushered Brand, 37, to another section.

PHOTOS: Katy's wildest video looks

When the comic learned Perry, 28, was there, he couldn't help but gawk.

Says the source, "On his way to the bathroom, he looked at [John and Katy] through a window!"

PHOTOS: John's famous flames

Perry, who married Brand in a lavish ceremony in India in October 2010, was blindsided when the British comedian filed divorce papers the following December. (The couple's divorce was finalized in July.) She has since moved on with Mayer, whom she showed around her hometown of Santa Barbara earlier this month.

This article originally appeared on Katy Perry Ducks to Avoid Russell Brand While Dining With John Mayer at L.A. Restaurant