Masri, who represented Palestine in the 5,000 meters at the Beijing Olympics, was one of nine runners along the full 42.2-km (26-mile) distance. He completed the course in two hours, 42 minutes, 47 seconds.
"We have championships coming up and I hope to be selected for the London Marathon in 2012," Masri said as supporters heaped congratulatory hugs and kisses on him at the finish line.
Masri cut a lonely figure in the Gaza Strip, territory controlled by Hamas Islamists hostile to Israel and blockaded by Israeli forces, as he trained for the local marathon.
He often ran past structures damaged in fighting, many of them in a three-week war that Israel launched in the enclave in December 2008 with the declared aim of halting cross-border rocket attacks.
Chris Gunness, a spokesman for the United Nations Relief and Works Agency (UNRWA) that cares for Palestinian refugees in the Gaza Strip, said the run had raised more than $1 million in sponsorship for children's summer camps in the territory.
"You have the London Marathon, the Sydney Marathon, the New York Marathon and now the Gaza Marathon, it just shows that Gaza could be a normal place if it got the chance," Gunness said.
Seven Palestinians and two foreigners living in the Gaza Strip took part in the full marathon. Some 1,300 schoolchildren joined the marathoners for the last kilometer of the run and 150 ran an eight-km course.
The event was the idea of Gemma Connell, a Gaza-based Australian UNRWA staffer, who ran in the race and said the money raised would help to send 250,000 children to UN-run summer camps in the enclave.
(Editing by Ori Lewis)