A San Francisco police officer whose hobby is photographing naked women has filed a federal civil rights suit against the city, saying he was wrongfully suspended twice because of his off-duty pastime.

In a suit filed in U.S. District Court in Oakland, Gared Hansen, 36, said the department suspended him twice, in 2009 and 2010, because "it did not approve of plaintiff's artistic expression," according to the suit filed Thursday.

It asserts the photography was done on Hansen's own time "with absolutely no connection to his employment."

Police and city officials declined to comment Tuesday, saying they had not seen the suit.

It seeks an unspecified amount in damages and lists the defendants as the city and Police Chief Greg Suhr, as well as George Gascón, Suhr's predecessor and currently San Francisco's district attorney.

Hansen, a police officer since 2005 who now works as a patrol officer, has been a photographer for 20 years and practices genres known as "creative photography and "figure study," the suit says.

Hansen has also described himself on websites that he specializes in "boudoir/pin-up photography."

One site maintained by Hansen warns viewers that it contains "nudity presented in artistic form. If you are offended by this or are in a location where viewing this is not allowed then please do not continue. Otherwise welcome and enjoy."

In 2009, the department suspended Hansen for five days after an internal investigation that was sparked by his artwork, the suit said.

The complaint did not specify the reasons for the suspension. Hansen was also assigned to jobs "widely known throughout the department as 'punishment' assignments," the suit said.

In 2010, Contra Costa County sheriff's deputies cited Hansen for trespassing after finding him and two models inside an abandoned Byron hotel commonly used by photographers, the suit said.

Hansen identified himself to the deputies as a San Francisco police officer. The department suspended him for 10 days for allegedly engaging in conduct that "reflects discredit to the department," the suit said.