A 20-year-old Chinese student has been sentenced to a year in a federal lockup after he pleaded guilty to illegally taking photos of a US military installation in the Florida Keys.

Zhao Qianli, a musicology student who traveled to the US for a summer exchange program, visited Key West after wrapping up his studies in September, according to the Miami Herald.

After being arrested for trespassing at the high-security naval air station, he told federal authorities that he wandered onto the military base after losing his way on the tourist trail.

Zhao entered the Joint Interagency Task Force South military property Sept. 26 without permission “by circumnavigating the installation’s primary fence line, and entering the military property from the beach,” CNN reported, citing court documents.

He then went directly to an area that contains satellite dishes and antennas called “the Farm,” according to the documents.

“The primary installation fence line contained multiple signs that stated the Farm area was a ‘RESTRICTED AREA’ and the ‘KEEP OUT,'” as did a secondary fence line, the filings say.

On Tuesday, he pleaded guilty to one count of photographing defense installations and received the maximum sentence, which was higher than the sentencing guidelines of between zero and six months, the Herald reported.

He expressed no remorse when he admitted through a Chinese interpreter that he took the illegal photos.

Federal prosecutor Michael Sherwin said Zhao waded into water while clothed to get around a security fence.

Investigators found incriminating photos and images on his cellphone and digital camera, according to the Herald.

“The primary pictures on that camera were of the military facility,” Sherwin said. “It did not have the hallmark of a tourist who got lost and wandered onto a military facility.”

The court documents gave no specific indication whether Zhao was trying to commit espionage.

His attorney, Hongwei Shang, insisted that her client was not a spy.

“A spy would not do things like him. There’s no proof … He committed a stupid mistake. He confessed to it. He just wants to go home,” she said.

A US Navy video calls the facility “one of the leading intelligence fusion centers in the world.” It tracks over 1,000 suspect targets a day, turning intelligence images into virtual-reality programs.