Australian Prime Minister Julia Gillard visited Australian troops and held talks with President Hamid Karzai during an unannounced visit to Afghanistan, national broadcasting network ABC News reported on Monday. The visit came as Gillard was on her way home from the G20 leaders summit in France, and the trip was kept secret for security reasons. Following a year since her first visit to the country, Gillard on Sunday attended a barbeque with Australian troops in the main Australian base at Tarin Kot in southern Afghanistan, where she thanked them and told them she wanted to hear their ideas about Australia\'s future role in the country. \"I thought it was important to come and touch base and to see what is happening here and to hear directly from you about what the world looks like through your eyes,\" she said. She held talks with coalition commanders and local Afghan officials before going on to meet Karzai in Kabul, affirming him that Australia would be engaged in Afghanistan for the long term. \"We came to Afghanistan and we have found some tremendous days of sorrow, but we have also found a great friendship,\" she said. \" We do intend to stay engaged here with you, in a spirit of friendship, for the long term.\" During her one-day visit, Gillard also opened the new Australian embassy in the capital, and praised diplomatic staff for their work in dangerous conditions. Last week, three Australian soldiers were killed, and others wounded, when an Afghan National Army soldier opened fire at a base in southern Kandahar province.