Israel’s miracle run at the 2017 World Baseball Classic came to an end Wednesday afternoon, as the blue-and-white team fell to Japan 8-3, knocking it out of the tournament after two weeks of play.

Israel entered the tournament as heavy underdogs, surprising the world, and its namesake country, by going undefeated in the first round and beating Cuba in the second round, becoming the WBC’s unlikely darlings.

Consecutive losses to the Netherlands and Japan, though, proved too much to overcome, and the team was forced to hang up its gloves without a trip to the championship rounds in Los Angeles.

Israel held Japan scoreless until the fifth inning, helped by the stifling pitching of Josh Zeid. Things fell apart in the sixth, though, as Japan scored five in front of a sold-out home crowd in Tokyo and never looked back.

Israel’s bats fell mostly silent over the first eight innings, before showing some life in the ninth.

Ike Davis broke the shutout bid with a single in the top of the ninth that scored Sam Fuld from second, and Ryan Lavarnway doubled in two more runs before Kazuhisa Makita retired the side in the ninth.

The Israeli team had needed a win to force a tiebreaker game that would have determined who would move on from the round robin.

Two-time champion Japan was heavily favored in the matchup, while Israel, a perennial underdog, has surprised many by making it even this far.

“We’re disappointed because we lost and won’t be moving on,” Israel manager Jerry Weinstein said. “But we lost to two excellent teams. Japan didn’t give anything away. They got timely hitting and really good pitching.”

Prime Minister Benjamin Netanyahu’s chief of staff Eli Groner praised the Israeli team, despite it being made up mostly of non-Israelis.

“Israel’s achievements in baseball this year are a source of Jewish and Israeli pride. These are players that take off their baseball hats and proudly wear skullcaps while singing the Israeli anthem before the game. That’s a diplomatic achievement that is going to stay with us for many years. The State of Israel and the Foreign Ministry invest many resources into building relationships with many countries in the world where baseball is an important sport, like Japan, Latin America, China, Taiwan and others, and therefore Israel’s success is not only an athletic success but also a diplomatic success,” he said in a statement.

Israeli infielder Ike Davis (R) is congratulated by his teammate Blake Gailen (#2) after arriving at the home plate by a double of catcher Ryan Lavarnway during the World Baseball Classic Pool E second round match between Cuba and Israel at Tokyo Dome in Tokyo on March 12, 2017. (AFP PHOTO / TORU YAMANAKA)

Israeli infielder Ike Davis (R) is congratulated by his teammate Blake Gailen (#2) after arriving at the home plate by a double of catcher Ryan Lavarnway during the World Baseball Classic Pool E second-round match between Cuba and Israel in Tokyo on March 12, 2017. (AFP/Toru Yamanaka)

Israel was the lowest-ranked team to qualify for the World Baseball Classic, coming in at 41st. Yet the team, with seven former major league players and 20 minor leaguers, started the tournament last week by beating third-ranked South Korea, fourth-ranked Taiwan and the ninth-ranked Netherlands to win its pool in the first round and become the only team to come out of the qualifying round and go undefeated. In the second round this week, Israel beat fifth-ranked Cuba before losing badly in the rematch with the Netherlands on Monday.

The trip has been Israel’s first to the tournament, coming as a surprise for the Middle Eastern country where baseball is about as popular as log rolling.

Thanks to WBC rules, which allow anyone with eligibility to be a citizen to play for a country’s team, Israel was able to cobble together a squad made up mostly of American Jews playing professionally in the US. The grandchild of a Jew, and that grandchild’s spouse, have the right to become Israeli citizens.

Infielder Cody Decker #14 of Israel holds team mascot 'The Mensch on a Bench' after the World Baseball Classic Pool A Game Five between the Netherlands and Israel at Gocheok Sky Dome on March 9, 2017 in Seoul, South Korea. (Chung Sung-Jun/Getty Images via JTA)

Infielder Cody Decker #14 of Israel holds team mascot ‘Mensch on the Bench’ after the World Baseball Classic Pool A Game Five between the Netherlands and Israel in Seoul, South Korea, on March 9, 2017. (Chung Sung-Jun/Getty Images via JTA)

Yet the team had taken on the Israel mantle with gusto, donning skullcaps for the national anthem Hatikvah before games, reading the Purim Megillah in the dugout on Sunday, dragging along its Mensch on the Bench mascot and making gear with a Star of David a hot commodity from Japan to the US.

“Two generations ago, we were being killed, being picked out, just because of our lineage,’’ catcher Ryan Lavarnway said at a news conference earlier this week, according to USA Today. “But two generations later, for us to be able to stand up here and to have the Israeli flag and the Jewish star hanging in the stadium, means a lot to a lot of people around the world… We’re here, we’re competing in a sport on the highest level, and we have the right to be here.’’

Israeli third baseman Ty Kelly (L) arrives at the home plate next to Cuban catcher Yosvani Alarcon after a single hit by right fielder Zach Borenstein at the top of the sixth inning during the World Baseball Classic Pool E second round match between Cuba and Israel at Tokyo Dome in Tokyo on March 12, 2017 (AFP PHOTO / TORU YAMANAKA)

Israeli third baseman Ty Kelly (L) arrives at the home plate next to Cuban catcher Yosvani Alarcon after a single hit by right fielder Zach Borenstein at the top of the sixth inning during the World Baseball Classic Pool E second-round match between Cuba and Israel in Tokyo on March 12, 2017 (AFP/Toru Yamanaka)

For the small Israeli baseball community, the run had been nothing short of astounding. The country has only three baseball-specific fields and only about 1,000 active players who are well accustomed to fielding incredulous questions from native-born Israelis about their funny gear and the difference between a home run and a strikeout.

Team manager Jerry Weinstein had acknowledged that generating more interest in Israel was one of the team’s primary goals.

“That’s what we’re trying to do, help grow the game in Israel,” he told reporters Saturday. “And I think that by playing in this [tournament] and doing well, we enlighten people’s awareness.”

Raphael Ahren, AP and JTA contributed to this report.