SALT LAKE CITY -- In a hearing filled with uncertainty and a little emotion, a former state lawmaker under consideration to be a judge apologized for past bills that appeared to target the LGBT community.

In reality, former Rep. Kraig Powell told the Utah Senate Judicial Confirmation Committee, he was trying to help in the aftermath of court rulings on same-sex marriage.

"I am not anti-gay," he told the committee during his confirmation hearing on Monday.

Powell faced opposition over his nomination to the Fourth District Court by LGBT rights and progressive activists that questioned his impartiality as a judge. Earlier this year, the Heber City Republican ran a pair of bills dealing with same-sex couples following the U.S. Supreme Court's marriage equality ruling. One actually earned him praise when he sought to make Utah marriage law gender neutral; the other got him scorn when he suggested giving heterosexual couples preference over same-sex couples in adoptions. (Neither bill passed in the legislature.)

Facing some tough questions from committee members over what he said at the time, Powell apologized on Monday to the LGBT community.

"I do understand the concerns expressed by the LGBTQ community over this issue and I'm truly sorry for the offense I caused," he said, vowing to be impartial as a judge. "I'm sorry that some of my statements about that provision were the source of such pain. I regret having made those statements."

Powell explained that he was trying to be responsive to all constituents in the aftermath of the Obergefell decision, noting that he faced criticism from conservatives for his bills.

"I think you were extremely brave," Sen. Lyle Hillyard, R-Logan, said of Powell's approach.

Sen. Jim Dabakis, D-Salt Lake City, the only openly-gay lawmaker on Utah's Capitol Hill, said he saluted Powell for trying to make marriage law gender neutral, but said of the adoption bill: "included in that was a poison pill, representative, that would have done great damage to LGBT couples."

In public comment, people were divided over "Judge Powell."

"Would my dignity and the dignity of my family and the honor of my family stand on level ground with any couple in the community?" asked Angie Rice, a transgender woman and Air Force veteran.

Kelleen Potter, a Heber City councilwoman who said she is the mother of a gay son and members of the LGBT supportive group "Mama Dragons," said she supported Powell's confirmation as a judge.

"Rep. Powell is open minded and willing to listen to all sides of an argument," Potter told the committee.

Troy Williams, the executive director of the LGBT rights group Equality Utah, who rallied supporters to oppose Powell's nomination, appeared to drop his fight after hearing from the former lawmaker.

"Recognizing the evolution and the journey that Rep. Powell has been on, I sincerely believe you and I accept your apology," he said.

Chase Thomas of Alliance for a Better Utah said he still had concerns.

"Although we appreciate the apology Rep. Powell expressed during his hearing today, we are still concerned about the implications of his confirmation as a judge," he said. "Rep. Powell may have backtracked on his stated desire to explicitly discriminate against LGBT parents who were trying to adopt, but his legislation as actually proposed still allowed for judges to act upon implicit biases they may hold toward LGBT persons."

Sen. Todd Weiler, R-Woods Cross, said he would not vote to confirm Powell as a judge if he believed he would be biased against LGBT people in a courtroom. Sen. Dabakis also joined in backing Powell and the committee confirmed him unanimously.

Summing up, Powell appeared to be emotional as he spoke of sharing a wedding anniversary with hundreds of LGBT couples who married the day same-sex marriage was legalized in Utah -- December 20.

"I recognize their marriages," Powell said, his voice choking.

The full Senate will vote on Powell's nomination as early as Wednesday.