TOKYO (Reuters) - Japanese Prime Minister Shinzo Abe’s ruling bloc avoided an embarrassing defeat on Sunday as an ally won reelection as mayor of Yokohama, with the premier planning to reshuffle his cabinet this week in an effort to boost his sagging support ratings.

Japan's Prime Minister Shinzo Abe speaks to the media at his official residence in Tokyo, Japan July 28, 2017. REUTERS/Toru Hanai

Mayor Fumiko Hayashi, backed by Abe’s Liberal Democratic Party (LDP) and its junior coalition partner Komeito, soundly defeated two opposition candidates, local media exit polls showed.

Hayashi’s win comes as Abe struggles with plunging support due to suspected cronyism scandals, the resignation of his defense minister and an impression among many voters that he has grown arrogant after more than four years in office.

Abe’s troubles are not immediately threatening his job and the main opposition party is weak and in disarray, but his sinking popularity could encourage LDP rivals to challenge him.

This month the LDP suffered an historic defeat to Tokyo Governor Yuriko Koike’s novice party in an election for the Tokyo Metropolitan Assembly, and another mayoral loss just last week.

Hayashi secured a third term in Yokohama with just over half the votes, besting opposition-backed Hirota Ito and Kazuyoshi Nagashima combined, local broadcaster Television Kanagawa said, based on exit polls.

The former autos sector executive told supporters her priorities were child-rearing and education, getting older people and women into the workforce and preparing Yokohama, a major metropolis bordering Tokyo to the southwest, for disasters such as earthquakes.

The idea of luring a casino to Yokohama to help boost the local economy was a focus of the election but Hayashi softened her support for the plan after opposition candidates came out against it.

Television Kanagawa said Yokohama residents opposed casinos by more than three-to-one.

Abe is expected to reshuffle his cabinet on Thursday, a move that could be risky if new ministers later commit gaffes or are found to have been involved in scandals.

For that reason, some media say the prime minister will draw heavily on lawmakers who already have ministerial experience, although speculation persists that he may draft Shinjiro Koizumi, 36, the popular lawmaker son of charismatic former prime minister Junichiro Koizumi, to garner favor with voters.