The Japanese softball team scores a victory to start off the Games.

TOKYO — The first competition of the Games began with a ball and ended with a home run.

Michelle Cox, the leadoff hitter for the Australian softball team, took a low pitch from Japan pitcher Yukiko Ueno in an empty stadium in Fukushima on Wednesday in the first competitive act of the Tokyo Olympics.

The pitch — after a bit of pregame pageantry that included the introduction of several officials and dignitaries — officially kicked off an edition of the Games that was years in the making and one year delayed by the coronavirus pandemic.

It was also the last offensive highlight for Australia. Japan responded with a run of its own in the bottom of the first, two in the third and three in the fourth. And when Yu Yamamoto hit a two-run homer in the fifth inning, Japan’s lead was 8-1 and the mercy rule was invoked, ending the game.

The game, two days before the opening ceremony, was the first of three in softball and a half-dozen in soccer that saw the first athletes take the field in the Games. Japan and Australia got the honor of going first; their game at the Fukushima Azuma Baseball Stadium was to be followed by matchups involving the United States and Italy and between Mexico and Canada.

Later on Wednesday, six matches — including the United States’ opener against Sweden in Tokyo Stadium — were to open the women’s soccer tournament.

It is not uncommon for Olympic competition to begin before the opening ceremony, a consequence of a tight schedule and expanded tournaments that can require longer than the Games’ official 17-day window to complete.

Cox, the first batter, made the most of her moment in the Olympic spotlight: She worked a full count against Ueno and then beat out an infield single back to the pitcher.

Ueno, Japan’s starter, had a rough inning. After giving up a single to Cox, she walked a batter and hit the next two with pitches. That allowed Cox to score the game’s — and the Games’ — first run.

But the hosts’ early nerves soon disappeared, and they steadily pulled away until, with one swing, Yamamoto sealed their victory.