Sen. Joe Donnelly, the vulnerable Democratic candidate running for reelection in Indiana, said he was open to looking at legislation that would end birthright citizenship during a Tuesday debate.

"I'm the only person on this stage who voted three times for a border wall. I voted against sanctuary cities. I've stood for secure borders with John McCain when in 2013, we passed legislation that would have provided an additional 20,000 border agents to the border," he said when asked about birthright citizenship.

"I heard you say that [Sen.] Lindsey Graham [R-S.C.] is going to put legislation forward" to rescind the law, Donnelly continued. "We have to take a look at that legislation."

"I'd want to see that legislation, make sure it was constitutional and review it first," he added.

Donnelly's Republican opponent Mike Braun also declined to commit his support to one side of the issue, but said that "if Lindsey Graham's introducing it, it will be something I take a look at."

President Trump made his intentions to use an executive order to end birthright citizenship known in an interview aired Tuesday. Legal experts quickly almost unanimously said that such a move would be unconstitutional and challenged in court.

Following the debate, Donnelly commented on the issue to The Hill.

"At tonight's debate, there was a question about birthright citizenship," Donnelly said in a statement. "The 14th Amendment is clear. What's also clear is that our immigration system is broken. As I have done in the past, I will work with both parties to find a solution that secures our borders and fixes our broken immigration laws."

Senate Judiciary Committee Chairman Chuck Grassley (R-Iowa) said Tuesday that changing birthright citizenship would take a constitutional amendment.

Recent polling of the Indiana Senate race has Braun with a slim lead within the margin of error ahead of the Nov. 6 election.

Updated Wednesday at 8:18 a.m.