Ukraine advanced to the Billie Jean King Cup semifinals for the first time in its history after winning both singles matches against five-time champion Spain on Wednesday.

Kostyuk gives Ukraine a winning start

In the first quarterfinal match, Ukraine’s Marta Kostyuk, ranked No. 26, came from a break down in the first set to defeat No. 51 Jessica Bouzas Maneiro in straight sets. Bouzas Maneiro broke early to lead 3-1, but the 23-year-old Ukrainian rallied to win the set in a tiebreak. She then cruised through the second for a 7-6 (3), 6-2 victory, giving her nation a 1-0 lead.

Svitolina beats Badosa in three sets to clinch the tie

In the second singles match, Spain’s Paula Badosa, playing her first match since Wimbledon after a recurring back injury, claimed a tight first set 7-5 over Elina Svitolina to keep Spain’s hopes alive.

But Svitolina, ranked No. 13, answered with a 6-2 second set and raced to a 4-1 lead in the decider. Badosa fought back to level the set before Svitolina earned the decisive break in the 12th game to close out a 5-7, 6-2, 7-5 win that sealed the tie for Ukraine.

The victory avenged Ukraine’s only other meeting with Spain in the competition — a 3-1 defeat in a 2013 World Group II tie.

Ukraine to face Italy in semifinals

Ukraine will next face another five-time champion, Italy, which defeated Japan 2-0 in Tuesday’s first quarterfinal. The remaining quarterfinals are scheduled for Thursday: Kazakhstan vs. the United States and Great Britain vs. Japan.