PERTH, Australia — After nearly two decades of appearing alongside each other on billboards and in record books, Serena Williams and Roger Federer faced off across a tennis court for the first time on Tuesday.

The incandescent stars, now both 37, finally aligned for the first time by taking part in a mixed doubles match between the United States and Switzerland at the Hopman Cup team event.

On the opening point, Williams pulled Federer wide to his forehand side with a sharply angled volley, then sent a smash toward the opposite corner that he could not reach in time to send back. Long exchanges between the two proved few, however, with each using their serve to effectively neutralize the other.

It did not seem to matter to the crowd of 14,064 in Perth Arena, the highest single-session attendance in the event’s 31-year history, and Williams and Federer clearly delighted in the chance to hit the ball around with each other a couple of weeks before more serious play occurs at the Australian Open.