As Birmingham Legion FC prepared for Wednesday’s game -- one vital for its chances to advance to the United Soccer League playoffs in its inaugural season -- midfielder Zach Herivaux was trying desperately to get back to the Magic City.

Herivaux had played all 90 minutes in Haiti’s national team in an international friendly match in Bolivia on Tuesday, but he was determined to make it back to Birmingham to help his team in its battle against the New York Red Bulls II.

Legion FC faced a must-win in its playoff quest, and Herivaux made it back to Birmingham just in time. He played 20 minutes in the team’s 2-1 victory, despite the long flight and fatigue from playing the previous night.

“I played until 8 o’clock in Bolivia, and right after went to the hotel and grabbed dinner and my stuff,” he said. “I went straight to the airport, flew into Columbia, then to Houston and Birmingham. From the airport I went straight to the locker room.”

The game in Bolivia was played at Estadio Ramón Tahuichi Aguilera, a soccer stadium with one of the highest elevations in the world.

The physical stress of playing in that elevation, along with the extended travel across distance and time zones, left Herivaux feeling taxed by the time the Legion FC game was set to start.

“It’s pretty difficult to play there, but I didn’t really realize how it was affecting me until I started warming up before the game in Birmingham,” Herivaux said. “I hadn’t been that sore for a long time.”

Herivaux’s dedication to the Birmingham team illustrates how the team bonded during the second half of the season.

Herivaux is on loan to Birmingham from Major League Soccer’s New England Revolution. A Boston native whose father was a Haitian soccer player who met his Japanese mother when playing internationally, has has played in 10 MLS games since signing in 2015.

Herivaux and other MLS loaner players, including leading scorer JJ Williams and Brian Wright, have been instrumental in Birmingham’s success. The loaner players’ talent was on display during a nine-game unbeaten streak and a league-leading 624-minute shutout streak during the second half of the season that put Birmingham in playoff contention.

Birmingham plays its final home game Sunday against Pittsburgh, and a victory will clinch a playoff berth.

“We’ve done it before, we’ve taken out the number ones,” Herivaux said. “We have lots of experienced players. It’s a home game and we’re healthy. If we stick to our plan, we should be in good shape.”

The team’s chemistry, Herivaux said, is vital to the end-of-the-season success.

“Ever since I got here, it’s been a family-type environment,” he said. “I really do love these guys, and I enjoy playing with this group.”

Herivaux said that his teammates encouraged him to make it back from the game in Bolivia, even though he initially thought they were joking.

After telling the other players that he’d consider getting back for the match, he talked to the Legion FC coaches to see if it was possible.

“I knew that this was a big game for us, and after talking to the coaches it was a no-brainer for me,” he said. “I want to do the best for the team and for the city.”

Herivaux said after initial qualms about Birmingham -- he said he’d heard a lot of “mixed things” about the city -- he has been pleasantly surprised with how much residents love soccer and support the upstart team.

“I can only say great things about the city,” he said. “The support of fans has been growing. The better we do, the better it gets. And they really gave us the energy in our last game. Having that support is huge.”

Legion FC’s success in its first year, as well as its ability to rebound when the season wasn’t going well, is testament, he said, to the team’s resiliency and potential.

And now Herivaux and the entire Legion FC team looks to the Sunday match, followed by a possible playoff run.

“We have everything going for us, especially with the type of season we’ve had,” he said. “With it being our first year together and the ups-and-downs we’ve had ... there’s really nothing more we can ask for. Everything’s in front of us, everyone’s buzzing about it and we’re together and ready.”