Queen's final day of state visit to Republic of Ireland
The Queen has finished her historic tour of Ireland with a visit to a market in Cork, where thousands of cheering spectators lined the streets.
She also visited one of the Republic of Ireland's most popular tourist sites, the Rock of Cashel in Tipperary, before leaving from Cork Airport.
During her four-day visit, the Queen has touched on the "troubled past" between Britain and Ireland.
She offered her sympathy to those who had suffered during past conflicts.
The Queen and the Duke of Edinburgh boarded a plane at Cork Airport where they were seen off by the Taoiseach [prime minister] Enda Kenny.
Earlier, she met the public in the crowds for the first time following her tour of the English Market.
They included hundreds of loudly cheering schoolchildren, as all schools in Cork city were closed in honour of the visit.
At the scene
The Queen was due just after 1400 BST on Friday and at the barriers lining the route of her cavalcade, they waited three and four deep, clapping and cheering every passing motorbike that may have heralded her arrival.
When she finally did pass, they received her with a welcome normally reserved for All-Ireland champions, straining forward to get any kind of glimpse.
Then, the younger ones especially, peered into their mobile phones and digital cameras to see what had been recorded for posterity.
Traders and staff inside the market applauded as the Queen inspected stalls packed with meat, fish and groceries.
Meanwhile, Sinn Fein staged a peaceful rally in opposition.
The English Market was given its name in the 1840s by the Protestant upper classes who frequented it to distinguish from another market which was used more by the city's Irish Catholic inhabitants.
The Rock of Cashel was the seat of the High Kings of Munster, long before the 11th Century Norman invasion, but most of the buildings on the current site date from the 12th and 13th Centuries.
According to legend, the rock was created when the devil spat out a piece of mountain he had bitten off during a battle with St Patrick.
The Queen and Prince Philip were shown around the complex, listened to harp playing and singing from schoolchildren, and signed the visitors' book.
The British monarch reverted to wearing green for her final day in the Republic of Ireland. She arrived on Tuesday, wearing green, and the colour choice for her trip generated much press coverage.
The BBC's Chris Buckler said the Queen saw the beautiful castle in perfect conditions. He said the rain clouds, which are perhaps more synonymous with trips to Ireland, disappeared and the sun came out just as she landed.'Very genuine'
Her final destination was Cork's Tyndale Institute where she met students and professors.
On Thursday, the Queen was shown around the Irish National Stud horsebreeding centre in Kildare, west of Dublin, and later attended a show by fashion designers and Irish performers at Dublin's National Convention Centre.
BBC royal correspondent Peter Hunt, who followed the Queen's visit, says the monarch will leave Ireland, "secure in the knowledge she has played a significant and striking role in the latest improvement to Anglo-Irish relations".
Former Taoiseach [prime minister] John Bruton told BBC Radio 4 Today's programme that Ireland had been "waiting a very long time for what should be normal between two neighbouring states" and the Queen's visit was very "symbolic".
"The fact the Queen herself has come, that she has put so much effort into it, displayed so much stamina and has been so warmly welcomed by people here, that is going to make a difference to the tone of the relationship," he said.
"It is going to make life much easier for the many Irish people living in Britain who now can find that their allegiance to the UK and their allegiance to Ireland are more easy to reconcile."
Sinn Fein leader Gerry Adams said the relationship would not be fully normalised while Ireland remained partitioned. He said the visit was "another page in the book".
End Quote Mark Simpson Ireland correspondent
She came, she saw, she conquered the sceptics”
But he added: "I was particularly taken by Queen Elizabeth's sincere expression of sympathy to all those who had suffered in the course of the conflict and I think that was very genuine."
The Queen's historic four-day visit was the first to the Republic of Ireland by a reigning British monarch.
The security operation surrounding the visit was one of the biggest mounted by the Republic of Ireland and there were no planned walkabouts for the Queen and Prince Philip due to the threat from dissident republicans.
However, the visit passed off with only a few minor scuffles between protesters and police.
Twelve people appeared in court in Dublin on Thursday night after Irish police recovered rockets, flares and fireworks.
The 11 men and one woman were arrested near the city's Connolly Station and it is alleged they were on their way to the Convention Centre.