An Israeli military court has released the Palestinian deputy prime minister, six weeks after detaining him in a crackdown on the Hamas movement.
Shaer's wife has campaigned for his release from Israeli detention
Nasser al-Shaer is the most senior politician to be freed from dozens arrested after Hamas militants captured an Israeli soldier near Gaza in June.
"There was no basis for his arrest. This is natural," his lawyer said.
About 30 Hamas figures remain in Israeli custody, some facing charges of membership of a terrorist organisation.
Mr Shaer managed to evade arrest for several weeks during the summer after Israeli troops seized dozens of Hamas officials following the capture of Cpl Gilad Shalit in June.
Israeli troops burst into a house in the West Bank city of Ramallah where he was hiding on 19 August.
Separately on Wednesday, an Israeli air strike in southern Gaza killed a 14-year-old Palestinian girl and injured several other civilians, Palestinian medics said.
The circumstances of the death are not clear, but Israel said it had fired at an arms smuggling tunnel.
The court order under which Mr Shaer was released reportedly says he must stay out of Ramallah, where the Palestinian government is situated, for two weeks.
On Monday, a military court refused to release 21 other detained Hamas officials on bail before legal proceedings against them had been concluded.
Mr Shaer's wife, who had campaigned for his release, confirmed to the BBC that her husband had been set free and was travelling home to Nablus in the northern West Bank.
As well as being deputy prime minister, Mr Shaer served as minister of education and training in the Hamas-led government which was elected by a landslide in January.
The movement does not recognise Israel's right to exist, which prompted western powers to stop funding to the Palestinian Authority and Israel to stop paying tax revenues, adding to a serious humanitarian crisis in areas the PA controls.
Government spokesman Ghazi Hamad said Mr Shaer's detention had been "political and illegal", and called charges against his colleagues "fabricated".