* Trip not previously announced
* Lebanese politicians hope Hariri will calm Sunni community
* Syrian conflict has spilled over dramatically into Lebanon
* Hariri brings Saudi backing for Lebanon's stretched army (Adds Hariri comments)
By Tom Perry and Oliver Holmes
BEIRUT, Aug 8 (Reuters) - Former prime minister Saad al-Hariri returned to Lebanon on Friday for the first time in three years, on a visit seen as reasserting a moderate influence over the Sunni community following a deadly incursion by Islamist militants.
Hariri, Lebanon's most influential Sunni politician, left Lebanon in 2011 after his government was toppled by a coalition including the Iranian-backed Shi'ite group Hezbollah, and has split his time between France and Saudi Arabia, whose rulers support him.
With no prior announcement, Hariri arrived at the Lebanese government's headquarters in Beirut in a Mercedes with blacked-out windows. He grinned widely as he walked into the building, where he met Prime Minister Tammam Salam.
"I have come back to Beirut today after an absence of three years and four months. It was the harshest punishment of my life and my return is my most important reward," he said in remarks to members of his Future Movement published by his media office.
Politicians and public figures expressed hope that his return would help stabilise Lebanon, which is plagued by violence and stuck in political deadlock. Divided politicians have failed in several attempts to elect a new president.
Hariri announced this week that Saudi Arabia would donate $1 billion in military aid to Lebanese security forces to help them in the fight against Islamist militants.
In his first detailed comments since arriving, he credited the Saudi Arabian donation for allowing him to come back, saying it had "opened the path for the return to my beloved country."
Hariri met Interior Minister Nohad Machnouk, as well as U.S. Ambassador David Hale. There was a chorus of support from other prominent figures including Christian Maronite Patriarch Beshara al-Rai and Shi'ite Parliament Speaker Nabih Berri.
Hariri's visit followed a deadly incursion by Sunni Islamist militants who crossed from Syria last Saturday and seized the Sunni town of Arsal in the northeast, where tens of thousands of Syrian refugees have taken shelter. The gunmen withdrew on Wednesday after five days of battles with the army.
The incursion by militants, including fighters affiliated to Islamic State, which has seized large areas of Iraq and Syria, was the most serious spillover yet of the Syrian conflict and triggered unrest in other parts of Lebanon, notably the predominantly Sunni northern city of Tripoli.
With the influence of hardline Sunni Islamist groups expanding in neighbouring Syria and Iraq, Hariri's arrival was greeted with relief by Lebanese concerned that his absence had left Sunnis vulnerable to radical influences.
His return coincides with growing signs of alarm in Saudi Arabia about Islamic State's reach. In his comments to Future members, Hariri said the party's role was "defending moderation and preventing extremism from spreading and expanding".
Walid Jumblatt, Lebanon's most influential Druze leader, who describes himself as a centrist but has switched alliance many times in the last decade, told Reuters it was "very positive":
"Facing the radicals, his presence is very important."
Political commentator Michael Young said that, since Hariri left, "a vacuum has formed in the Sunni community".
"This was becoming increasingly dangerous because this community was becoming more and more radicalised," he said. "(Hariri's) return is probably an effort with the Saudis to reassert a certain amount of control over the Sunni community."
Hariri also visited the grave of his father, Rafik al-Hariri, another former prime minister whose assassination in Beirut in 2005 pushed Saad to enter political life.
Hariri blames Syrian President Bashar al-Assad for the murder. A special tribunal in the Netherlands has been trying four members of Hezbollah, allied with Assad, in absentia for the killing. The group denies any involvement.
Hariri criticised Hezbollah's intervention in Syria, saying it would "only bring harm to Lebanon" but added that if Hezbollah had made mistakes it did not mean that "we respond to them with similar mistakes."
Assad cracked down on Syria's pro-democracy movement in 2011 in a move that has led to a full-scale civil war pitting Sunni rebels against Assad's Alawite sect and Shi'ite fighters.
Since then, rocket fire, suicide attacks and gun battles connected to Syria's war have plagued its smaller Mediterranean neighbour and worsened its perennial political deadlock, which runs largely along sectarian lines.
Lebanon has been without a president since May, when Michel Suleiman's term expired. Hariri urged lawmakers to move forward with electing a new president. "Electing the president is everyone's responsibility. It is not true that it is a responsibility borne by Saad al-Hairi alone," he said in the Future Movement meeting.
Tripoli has seen regular skirmishes between Sunni and Alawite militiamen. Firebrand Sunni clerics such as Salafist leader Ahmad al-Assir have urged Sunnis to fight the Beirut government, which includes Hezbollah. (Additional reporting by Alexander Dziadosz; Editing by Kevin Liffey and Robin Pomeroy)