WASHINGTON — The Russian graduate student who tried to infiltrate conservative, influential Republican circles during the last presidential campaign was sentenced on Friday to 18 months in prison for serving as an unregistered Russian agent in the United States.

The student, Maria Butina, 30, pleaded guilty late last year to working on the Russian government’s behalf in the United States from 2015 to 2017 without registering with the Justice Department, as required.

Her defense lawyers cast her as an ambitious, well-meaning young woman who hoped to foster better relations between the United States and Russia. In a tearful voice, Ms. Butina told Judge Tanya S. Chutkan of the United States District Court for the District of Columbia, “I just didn’t register because I didn’t know to.”

But prosecutors argued that Ms. Butina forged links with National Rifle Association officials and other influential Republicans, aiming to create back channels of communication that could pay off if Republicans seized the White House. They said a senior Russian official directed her activities and shared some of her reports within the Russian government. A counterintelligence expert said her reports would have helped Russian intelligence “spot and assess” potential American recruits.