A former civilian defence contractor working at the US military's Pacific headquarters was sentenced to seven years and three months in prison for divulging military secrets to his Chinese girlfriend and keeping classified documents at his Honolulu home.

Benjamin Bishop demonstrated poor judgment and jeopardised national security because of an intimate relationship, said US District Court Judge Leslie Kobayashi during his sentencing hearing on Wednesday. That he would risk everything showed the girlfriend "has control over you", the judge told Bishop.

Bishop's move to contact the girlfriend from a halfway house he was allowed to stay at while awaiting trial, even though he was forbidden to do so, showed a continued lapse of judgment, she said.

"This makes the court question your ability to follow the law when it comes to this person," Kobayashi said.

Bishop, 60, will get credit for about a year he's already spent at the federal detention centre in Honolulu since his arrest in March 2013. He faced up to 10 years in prison.

Defence lawyer Birney Bervar argued Bishop should be sentenced to time served.

"He made an error, a serious error in judgment over the love of a woman. As one of his friends said in a letter quoting Shakespeare, 'he loved not wisely, but too well'," Bervar told reporters.

The girlfriend was a Fulbright scholar working on her doctorate on security issues at a US university.

Bishop pleaded guilty in March, saying he mentioned a classified conference between US and South Korean officials while responding to an email from the girlfriend, who is in her late 20s.

He also admitted to keeping classified documents at his home, including ones outlining the US Pentagon's China strategy and the US military's force posture in Asia and the Pacific.

Bishop told Kobayashi his only intent was to help his girlfriend, whom he called a "brilliant academic".

"In my efforts to help her, I went too far and made mistakes," he said.

Bishop worked in the field of cyberdefence at the US Pacific Command in Hawaii from May 2011 until his arrest. Before that, he helped develop Pacific command strategy and policy. He retired from the US army reserve as a lieutenant colonel a year ago.

Authorities have not released the girlfriend's identity or whereabouts, or said publicly whether they believe she was working for the Chinese government. She was a Chinese national and living in the United States as a student, according to the FBI.

Assistant US Attorney Ken Sorenson told the court Bishop should have known better as an experienced army officer, noting countries use sexual relationships to gather military secrets.

"All of the warning signs were there and he disregarded them," Sorenson said in court.

He said the girlfriend made Bishop her pawn, as she had him research classified documents to give her information.

Sorenson called the sentence fair. "We think it sends a message that individuals who compromise US national security by disclosing classified information are going to face severe sanctions," he told reporters.

This article appeared in the South China Morning Post print edition as: Contractor jailed for giving secrets to Chinese lover