Wearing a green hat and coat, Queen Elizabeth II on Tuesday became the first British monarch in a century to set foot on Irish soil, during a trip designed to celebrate improved Anglo-Irish relations.

In a scene that seemed impossible until recently, the British anthem, “God Save the Queen,” rang out moments before the queen laid a wreath at a garden in Dublin dedicated to those who lost their lives struggling for Irish freedom, often against oppressive British control.

But the historic nature of the tour threatened to be overshadowed by security jitters.

After a telephone tip, an improvised explosive device was discovered on a bus outside Dublin late Monday, just hours before the queen arrived in Ireland with her husband, Prince Philip. The bomb, described as “viable” by Irish police, was disabled.

Earlier Monday, British police received a coded bomb threat for central London, sparking heightened security in the British capital. Authorities said they suspected the threat came from dissident Irish Republicans.

The Irish police force, which canceled all vacation leave for the second half of May, has deployed more than 8,000 officers to maintain security during the queen’s four-day visit, and the Irish army has mobilized more than 2,000 troops.

The queen is the first reigning British monarch to visit Ireland since the country’s 1922 independence from Britain and an ensuing civil war that ended with the mostly Protestant six counties of Northern Ireland still part of the United Kingdom. The last to visit was her grandfather, King George V, who traveled to Dublin in 1911.

Irish President Mary Mc­Aleese, who invited the queen, told Ireland’s RTE News network the royal visit was “an extraordinary moment in Irish history, a phenomenal sign and signal of the success of the peace process.”

The queen’s itinerary includes a visit to Dublin’s Croke Park, which is a sports stadium and site of the original Bloody Sunday massacre in 1920 in which British forces opened fire during a Gaelic football match, killing 14 civilians. David Cameron, the British prime minister, is to join the queen Wednesday for a portion of her trip.

The long-anticipated visit by the 85-year-old monarch — a celebration of normalizing relations — was all but unthinkable during the three decades of armed conflict in Northern Ireland known as “the Troubles.” Members of the province’s Catholic minority, seeking equal civil rights and largely backing a unified Ireland, battled Protestant Unionists, who supported continued ties with Britain. The conflict claimed the lives of more than 3,600 people, including Louis Mountbatten, the queen’s cousin.

But the peace process has slowly taken root in Northern Ireland after landmark events such as the Good Friday peace accords in 1998 and the Irish Republican Army’s decommissioning of weapons in 2005.

Still, although a large majority in Northern Ireland supports the peace process, splinter groups opposed to the Catholic-Protestant power-sharing government continue to engage in sporadic bouts of violence.

Several protests were staged in Dublin on Tuesday, leading to more than a dozen arrests. Sinn Fein — whose president, Gerry Adams, has called the queen’s trip “premature and insensitive” — released 1,000 black balloons that floated up across Dublin’s skyline.