Sun Valley residents vote at the polling station located at Our Lady of The Holy Church on election day at the Sun Valley's Latino district, Los Angeles County, on November 6, 2012 in California.AFP PHOTO /JOE KLAMAR        (Photo credit should read JOE KLAMAR/AFP/Getty Images)
JOE KLAMAR/AFP/AFP/Getty Images
Sun Valley residents vote at the polling station located at Our Lady of The Holy Church on election day at the Sun Valley's Latino district, Los Angeles County, on November 6, 2012 in California.AFP PHOTO /JOE KLAMAR (Photo credit should read JOE KLAMAR/AFP/Getty Images)
Now playing
01:21
Why the 2018 midterm elections matter
senator bill nelson 11132018
CNN
senator bill nelson 11132018
Now playing
02:03
Nelson: Scott should recuse himself
Rep. Marsha Blackburn, R-Tenn., speaks to supporters after she was declared the winner over former Gov. Phil Bredesen in their race for the U.S. Senate Tuesday, Nov. 6, 2018, in Franklin, Tenn. (AP Photo/Mark Humphrey)
Mark Humphrey/AP
Rep. Marsha Blackburn, R-Tenn., speaks to supporters after she was declared the winner over former Gov. Phil Bredesen in their race for the U.S. Senate Tuesday, Nov. 6, 2018, in Franklin, Tenn. (AP Photo/Mark Humphrey)
Now playing
01:26
Meet the Republicans who held onto the Senate (2018)
Democratic congressional candidate Ilhan Omar is greeted by her husband's mother after appearing at her midterm election night party in Minneapolis, Minnesota, U.S. November 6, 2018. REUTERS/Eric Miller
Eric Miller/Reuters
Democratic congressional candidate Ilhan Omar is greeted by her husband's mother after appearing at her midterm election night party in Minneapolis, Minnesota, U.S. November 6, 2018. REUTERS/Eric Miller
Now playing
01:33
Minorities, LGBT make history in 2018 midterms
WJLA
Now playing
02:01
Hear from the Democrats who took back the House
CNN
Now playing
01:50
Abrams vows to remain in gubernatorial race
Spectrum News NY1
Now playing
02:05
Ocasio-Cortez: This is a movement for justice
KXAN
Now playing
02:07
O'Rourke congratulates Cruz on his victory
CNN
Now playing
01:57
Tapper: This is not a blue wave
CNN
Now playing
02:11
Van Jones: It's a rainbow wave
LAS VEGAS, NV - OCTOBER 20:  U.S. Rep. and U.S. Senate candidate Jacky Rosen (D-NV) speaks during a rally at the Culinary Workers Union Hall Local 226 featuring former U.S. Vice President Joe Biden on October 20, 2018 in Las Vegas, Nevada. Early voting for the midterm elections in Nevada begins today. (Photo by Ethan Miller/Getty Images)
Ethan Miller/Getty Images
LAS VEGAS, NV - OCTOBER 20: U.S. Rep. and U.S. Senate candidate Jacky Rosen (D-NV) speaks during a rally at the Culinary Workers Union Hall Local 226 featuring former U.S. Vice President Joe Biden on October 20, 2018 in Las Vegas, Nevada. Early voting for the midterm elections in Nevada begins today. (Photo by Ethan Miller/Getty Images)
Now playing
01:45
CNN projects Jacky Rosen elected to US Senate
Additional Embargo:   Additional Source(s):    Date Shot: 11/6/2018   Shipping/Billing Info:     Description: Projects: None  Cost Center: Atlanta National Desk / 20100101   Created By: DHackett  On: 1541544461  --------------------------------------------------------------------------------
WSB;
Additional Embargo: Additional Source(s): Date Shot: 11/6/2018 Shipping/Billing Info: Description: Projects: None Cost Center: Atlanta National Desk / 20100101 Created By: DHackett On: 1541544461 --------------------------------------------------------------------------------
Now playing
00:59
Brian Kemp: Confident victory is near
2018 Elections Primary Clean path
CNN
2018 Elections Primary Clean path
Now playing
01:49
Pelosi: Tomorrow will be a new day in America
CNN
Now playing
01:36
The Democrats who might lead the House
CNN
Now playing
01:54
DeSantis thanks Trump in victory speech
KXAN
Now playing
01:44
Cruz: This election was a battle of ideas
(CNN) —  

A Kentucky high school teacher on Tuesday ousted an incumbent state lawmaker who had a role in passing a controversial pension bill this year that sparked outrage from teachers across the state.

Republican voters chose Travis Brenda, a high school math teacher, over House Majority Floor Leader Jonathan Shell, who was first elected in 2012.

Brenda bested Shell by a narrow margin of 123 votes In Tuesday’s Republican primary for House District 71st, according to unofficial results posted to the Kentucky State Board of Elections.

This past spring, Kentucky teachers held rallies at the state Capitol for more funding and to oppose a controversial pension bill, Senate Bill 151, which, among other initiatives, prevents changes to annual cost-of-living adjustments and limits the number of sick days teachers can put toward their retirement.

Shell had helped turn SB 151, which had been about sewage services, into a pension overhaul and voted in support of the bill. The bill was quickly passed in the House and the Senate without allowing the public to read it, and then sent to GOP Gov. Matt Bevin to sign the bill on April 11.

During the campaign, Brenda used his experience as a teacher to make the point that he’s not a politician and he understands the importance of funding education. On Twitter, Brenda was critical of the pension bill and posted pictures from the April 2 teacher protest at the state Capitol.

Shell confirmed to CNN he called Brenda Tuesday night to congratulate him. Shell, once considered a rising star in Kentucky Republican politics, said he was grateful for the six years he served and now looks forward to spending more time with his wife and kids.

Brenda will go on to face Democratic candidate Mary Renfro in November’s general election.