For Mr. Cuellar, evolution on guns may be necessary for political survival. In the last election cycle, he was one of only three House Democrats — the others are Representatives Sanford D. Bishop Jr. of Georgia and Collin C. Peterson of Minnesota, who also have A ratings — who took contributions from the N.R.A.’s political action committee.
Now, he is facing a new reality: a primary challenge from the left.
His opponent, Jessica Cisneros, 26, an immigration rights lawyer who once worked as Mr. Cuellar’s intern, is backed by the Justice Democrats, the group that helped elect Representative Alexandria Ocasio-Cortez, the liberal firebrand from New York. Ms. Cisneros has demanded that Mr. Cuellar give back his N.R.A. contributions, including $6,950 he received for his 2018 race.
In 2017, another House Democrat, Representative Tim Ryan, who also once had an A rating from the N.R.A., announced he would donate roughly $20,000 that the gun lobby gave him to gun safety groups.
“I truly believe that somebody like him, somebody that takes money from the N.R.A., somebody that received support and an A rating from the N.R.A., cannot call themselves a Democrat,” said Ms. Cisneros of Mr. Cuellar. “I think it’s very tone-deaf.”
On Monday, Senator Elizabeth Warren, Democrat of Massachusetts, a 2020 presidential candidate who has built her campaign around progressive activism, endorsed Ms. Cisneros, saying that people in the district “deserve a Democrat that will be on the side of working people, not the side of big money and obstructionist Republicans.”
Mr. Cuellar said he had no intention of returning the N.R.A. money, which he characterized as minimal and without influence on his votes. He called Ms. Cisneros and her backers “justice socialists” and said that in a district like his, which includes “urban areas, rural areas, people that might not believe in guns, people that do believe in guns,” he has “balancing work” to do.