Thirty passengers hurriedly left the coach when it was stopped and searched 40 miles from the city.
The explosive device was discovered in a holdall in the luggage compartment when it was checked in Maynooth, Co Kildare late last night.
The bus had been on its way from Ballina, Co Mayo, on the west coast of Ireland.
The device was found 12 hours before the Queen and the Duke of Edinburgh were due to touch down at Baldonnel, west Dublin, heightening fears of some sort of attack by dissident republicans to disrupt the historic visit.
Army bomb experts carried out a controlled explosion during a three hour operation.
The bus - operated by the state-owned Bus Eireann company - had been stopped outside an hotel, apparently after a tip-off.
The passengers were told to get off and move well clear.
Later, police held back noisy demonstrators as the Queen took part in a wreath laying ceremony at the Garden of Remembrance in Dublin city centre.
There was minor trouble as republicans opposed to the visit and the peace process in Northern Ireland jostled with police.
At one stage two flares were lit and thrown into the air.
The ceremony, the first major engagement of the Queen’s visit, started on time but, with thousands of police officers lining the route along the city’s main thoroughfares, the security operation was the biggest ever mounted in the history of the state.
Fewer than 100 protesters scuffled with riot police as fireworks, bottles and cans were thrown by dissident republican supporters, some carrying placards in support of the 32 County Sovereignty Movement - the political wing of the Real IRA, which bombed Omagh in 1998, killing 29 people.
The Queen, who changed into a new outfit for the poignant and symbolic wreath-laying having arrived in Dublin in green, looked unperturbed as the ceremony took place at the Garden of Remembrance, which honours all those who fought for Irish freedom from British rule.
Snipers and armed police patrolled rooftops and a church spire overlooking the garden as spotter planes and the garda helicopter circled above.
The riot police maintained order at two separate protests on streets several hundred yards from the garden.
The largest police presence ever seen in the country was deployed the entire length of the route as the Queen and President Mary McAleese travelled for the commemoration.
Several hundred onlookers eager to catch a glimpse of the monarch were also on roadsides in the city centre.
The garden opened in Easter 1966 to mark the 50th anniversary of the 1916 Rising when seven signatories to Ireland’s Proclamation of Independence, backed by the 1,000 strong Irish Citizen Army, launched a revolution against British rule beginning with the takeover of the GPO a few hundred yards away on O’Connell Street.
It is dedicated to “the memory of all those who gave their lives in the cause of Irish freedom”.
The Queen’s attendance at the garden is a required element of the State visit under diplomatic protocol.
As the monarch arrived the Irish Tricolour flew at half mast.
God Save the Queen was played as the Queen and President stood side by side in front of the Children of Lir sculpture to perform the wreath laying.
The Queen, wearing an ivory coloured coat with light green trim, laid a wreath first before stepping back to bow, in an extraordinary moment in Anglo-Irish history.
The President then stepped in to lay a wreath before a minute’s silence.
The Irish poem Rinneadh Aisling Duinn (We saw a Vision) was read out before the Guard of Honour presented arms and the last post sounded.
As the ceremony drew to a close the Tricolour was adjusted to full mast and the Irish national anthem Amhran na bhFiann was played.
The small scale protests could not be heard in the garden.
The Queen travelled the short distance down O’Connell Street and past the monument to Charles Stewart Parnell, who battled for home rule for Ireland, and the sight where the Proclamation was read out, the steps of the GPO, to Trinity College.
The university was founded in 1592 by Elizabeth I.
The Queen was cheered by students and staff as she arrived in the grounds of Trinity.