By Scott Malone and Jacqueline Tempera

BOSTON (Reuters) - A citizen of Kyrgyzstan who was friends with the Boston Marathon bombers apologized on Thursday for lying to investigators probing the deadly 2013 attack and was then sentenced to 2-1/2 years in federal prison.

Cab driver Khairullozhon Matanov is the fourth person connected to ethnic Chechen brothers Dzhokhar and Tamerlan Tsarnaev to face jail time for misleading investigators during the massive search for the men who killed three people and injured 264 with a pair of homemade pressure-cooker bombs.

He looked pale in court on Thursday, and tears could be seen in his eyes as U.S. District Judge William Young read his sentence.

"I want to apologize for lying to the FBI," Matanov said. "I'm not sympathetic of any terrorist organizations."

Matanov's case dates back to the morning of April 19, 2013, when he went to a police station in Braintree, Massachusetts, south of Boston, to say that he recognized the Tsarnaevs in surveillance photos the FBI had released the night before.

Matanov was not accused of playing any role in the attack. He pleaded guilty in March to lying to investigators about how well he knew the Tsarnaevs, including the fact that he bought the brothers dinner hours after the bombings. Matanov said he was unaware of their role in the attack during the meal.

"All we asked you to do was give a hand. All we wanted you to do was help us out, but you didn't do that," Young said. "You had a duty to humanity and you failed in that duty."

Young accepted a request by Matanov's lawyer that he be moved to a low- or medium-security prison so that he could continue his education.

Absent a plea, Matanov, who was arrested in May 2014, could have faced 20 years in prison.

Dzhokhar Tsarnaev, 21, was convicted in April of carrying out the bombing and shooting dead a police officer. He is due to be formally sentenced to death next week. Tamerlan, who was 26 at the time of the attack, died after Dzhokhar ran him over with a stolen car following a gunfight with police hours before Matanov went to the police.

Three college friends of the younger Tsarnaev, Kazakh exchange students Dias Kadyrbayev and Azamat Tazhayakov, as well as Robel Phillipos of Cambridge, Massachusetts, earlier this month were handed sentences ranging from three to six years in prison for interfering with the investigation.

(Reporting by Scott Malone; Editing by Lisa Shumaker and Lisa Lambert)