MANILA — The interior secretary and the head of the military on Saturday declared an end to a three-week standoff between rebels and government forces in the southern Philippines by raising the country’s flag at the site of some of the fiercest fighting.

“The siege in Zamboanga City is over,” Interior Secretary Mar Roxas told reporters in the embattled town on Saturday. “We honor the fallen, the brave soldiers and policemen who died for the sake of countrymen and the innocent civilians who were sacrificed at the altar of the selfish interests of a few.”

Defense Secretary Voltaire Gazmin said Saturday that a few rebels remained in the city and were being pursued by the military and the police. Mr. Roxas said sporadic fighting could continue in the city for two more weeks as the remaining rebels were located.

More than 200 people — rebels, soldiers, police officers and civilians — were killed during the standoff, and the clashes displaced more than 100,000 residents and strangled the economy of what had been a vibrant trading enclave.