Keen to promote itself as a tourist hotspot just beyond the edges of Europe, Tel Aviv has gone all out to shine for Eurovision.

Street signs in English have been hoisted, hundreds of volunteers walk around the city in “ask me” T-shirts and soon free buses will be operating. On the beachfront, a giant “Euro Village” festival with a 50,000 capacity will run all this week, packed with food trucks and gigs.

Yet hosting Eurovision was never going to be straightforward for Israel. Last year one of the biggest controversies facing the Portuguese organisers centred around whether a meagre budget would allow for sufficiently flashy stage lighting. There was also some fuss about 90-minute toilet queues. Slightly more contention has plagued the 2019 show that begins on Tuesday in the Mediterranean city and reaches its wildly kitsch culmination on Saturday night.

Singer Netta, representing Israel, wins last year’s Eurovision Song Contest in Lisbon. Photograph: Vyacheslav Prokofyev/TASS

Israeli politicians bickered over their craving to hold it in Jerusalem, a disputed city Israel claims in its entirety. Jewish religious communities were angered that finals begin on the Sabbath. And Palestinian activists and celebrity backers have pressed for a global boycott of the entire event.

Most alarming of all – and as contestants were arriving to begin rehearsals last weekend – militants in Gaza launched barrage after barrage of rockets and mortar bombs at towns in the country’s south while Israel’s air force bombed hundreds of sites across the strip.

The three-day battle, which killed 23 people in Gaza and four in Israel, was one of the deadliest clashes since the 2014 war, but ended abruptly with an unofficial truce. It may even have been an attempt to preserve Eurovision that averted another full-blown conflict, of which there have been three since Hamas took control in 2007.

“Hamas must go,” tweeted Michael Oren, Israel’s deputy minister for public diplomacy and a former ambassador to the US, repeating a long-standing Israeli ambition in the middle of the fight to topple the Palestinian faction. But he added a qualification: “Right after our [independence and Memorial Day] holidays and Eurovision.”

Other ministers have scrambled to deny that an international music event is a priority in military considerations. But the world’s longest-running televised song competition, taking place on 14-18 May and watched by millions worldwide, certainly added pressure on Israel to quickly end the current fighting.

“Initially people thought I was kidding, but I think Eurovision was a huge calculation in [prime minister Benjamin] Netanyahu’s response and his agreement to a ceasefire,” said Israel-based political analyst and journalist Neri Zilber.

Israeli and Arabic-language media reported that Israel ended the fighting by offering a series of measures, including easing the 12-year land, air and sea blockade it has imposed on Gaza to squeeze Hamas – one the UN slams as collective punishment for 2 million residents trapped in dire humanitarian conditions.

The deadline to implement the measures was one week, just ahead of the Eurovision semi-final, reports said. Zilber says the timing was no coincidence as Hamas knows Israel will be under duress to comply or risk another flare-up as the competition gets under way. “They want to see movement right now,” Zilber said.

As the fighting died down last Monday, the Hebrew-language free daily Israel Hayom headlined with “Eurovision’s Hostage”. In Maariv, another national newspaper, columnist Ben Caspit wrote, “Israel has been subjected to extortion and is quaking in its boots lest the Eurovision be cancelled.”

Women pose for a selfie in Tel Aviv during Israel’s Independence Day celebrations last week. Photograph: Corinna Kern/Reuters

Sharon Ben David, spokesperson for the Israeli public broadcaster Kan, which is showing this year’s contest, said each of the 41 delegations arriving for rehearsals had been assigned a security aide, who detailed security and safety issues from petty theft to what to do in a crisis. “They told them about independence day [on Friday] with all the fireworks. You know, when people arrive here they might not know what it means, so we explained. And also what about what to do in an emergency, if there is an alarm,” she said.

The security aide decision was made before the violence last weekend, she said, “but it became much more relevant”.

Last week, Kan ran a farcical, self-parodying promotional video called “Eurovision 2019 – the musical” mocking attempts to improve Israel’s image ahead of the contest. In it two Israeli singers welcome international visitors, regaling them with their loves and frustrations with the country.

“I know just what you heard, that it’s a land of war and occupation,” one sings, taking their bags at the airport. “But we have so much more than that,” sings another.

“This is the land of honey, honey, we are the land of milk,” they chant. “The land is always sunny, sonny, we are as smooth as silk.”

One fear among organisers was that an act might pull out of Eurovision in protest. But none so far have heeded calls from the Boycott, Divestment, Sanctions (BDS) campaign, which accuses Israel of exploiting the event to “whitewash” its treatment of Palestinians.

Palestinians among the wreckage after Israeli airstrikes in Gaza City last week. Photograph: Anadolu Agency/Getty Images

So contentious are boycott calls that the government effectively outlawed them, passing a bill in 2017 barring entry to BDS supporters. Israel will use “legal instruments” to also block entry to activists who want to “disturb” the competition.

Eurovision is being held in the same week as Palestinians commemorate the Nakba, meaning “catastrophe”, when more than 700,000 fled or were expelled from towns and villages in the war surrounding Israel’s creation 71 years ago.

Palestinian activists have pointed out that Expo Tel Aviv, the venue for Eurovision, was built on the land of the former Arab village of al-Shaykh Muwannis, which was emptied of its residents during the same war.

The week Palestinians remember the Nakba is often marked by protests, and last year Israeli snipers killed nearly 60 people at the Gaza frontier in one day, bloodshed that continued and sparked further clashes between Israel and militants. Since then, Israeli forces have killed more than 200 people and wounded 7,000 others with bullets at the rallies, which are backed by Hamas.

As an alternative to Eurovision and in protest against it, Palestinian and international musicians plan a competing event during the finale that will be broadcast online. Globalvision will include live shots of concerts in Haifa, Dublin and Bethlehem.

Eurovision has also attracted criticism from Orthodox Jews in Israel as the final will begin just at the end of Shabbat, where religious Jews refrain from work of any kind. In February, an Israeli band dropped out of the contest as it would force some of its more observant members to rehearse next weekend before Shabbat ends.

A decision by the Tel Aviv municipality to make an exception to their usual rules and run two free bus lines on the day has also brought criticism from some quarters. Public transport is usually unavailable in Israel from sundown on Friday to nightfall on Saturday.

The Labour ministry plans to allow employees to work on Shabbat for the event, which is even affecting the prime minister’s ongoing efforts to form a coalition government with religious factions, allies he desperately needs.

United Torah Judaism, an ultra-Orthodox political party, said it had temporarily cancelled discussions with Netanyahu: “We will not remain silent about the desecration of Shabbat.”