Police say they have recovered a long-arm rifle and a pistol following an eight-hour siege at a McDonald's restaurant on the New South Wales mid-north coast.

A Sydney man in his late 40s has been arrested after surrendering to police at around 4:30pm (AEST).

He had walked into the restaurant in Port Macquarie about 8:00am and fired two shots from a gun, forcing the evacuation of more than 20 staff and customers.

Police Commander Paul Fehon says no-one was injured during the standoff.

"Negotiators and the Tactical Response Unit have secured the surrender of the person and he exited the restaurant," he said.

"The person was spoken to for approximately eight hours. Two weapons have been located and they've been secured."

At one point during the siege the man went outside the building but walked back in shortly afterwards.

The media and public had been kept well back behind police cordons, while the Oxley Highway was also closed.

A McDonald's spokeswoman says it is not known what sparked the incident.