A Chinese man was arrested Thursday while taking photos at a U.S. Navy base in Florida, authorities said.

Witnesses observed Lyuyou Liao walking around a perimeter fence of a Naval Air Station in Key West and entering the facility from the rocks along the water at about 6:50 a.m. Thursday, according to a federal complaint.

Liao was warned by witnesses that he was trespassing in a restricted area, known as the Truman Annex, as he took photographs of government buildings near “sensitive military facilities,” the complaint states.

When U.S. Military Police saw Liao snapping photos with his cellphone, they approached him and he stated in broken English that he was "trying to take photos of the sunrise," according to the complaint filed Thursday.

With Liao's consent, officers looked at the photos on his camera and found images of the buildings and other property on Truman Annex, the complaint states. Officers called a federal agent, who arrested Liao on a charge of entering naval property for the purpose of photographing defense installations.

Liao had his first federal court appearance Friday afternoon, according to the Miami Herald. A judge appointed the federal public defender’s office to represent him and scheduled his pretrial detention hearing for Jan. 6, the newspaper reported.