A teacher has defeated the Kentucky state House majority leader in the GOP primary for his seat, months after educators protested state lawmakers for passing a controversial pension bill.

High school math teacher Travis Brenda narrowly beat out House Majority Floor Leader Jonathan Shell Tuesday in the Republican primary for the 71st House District seat, The Associated Press reported.

ADVERTISEMENT

Brenda credited the backing of teachers for his win, adding that it sends a message to lawmakers that public employees won't stay quiet, according to the AP.

Shell had played a prominent role in the pension bill, which sparked teacher protests at the state Capitol earlier this year.

Schools across the state shut down as educators spoke out against the measure, which made significant changes to the pension system and was quickly passed during the final days of the legislative session.

Two years ago, he had also helped lead the first Republican takeover of the Kentucky state House of Representatives in nearly a century, according to the AP.

He was also considered a possible rising star within the GOP and had the backing of Senate Majority Leader Mitch McConnell Addison (Mitch) Mitchell McConnellPelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Senate GOP aims to confirm Trump court pick by Oct. 29: report Trump argues full Supreme Court needed to settle potential election disputes MORE (R-Ky.), according to the Lexington Herald-Leader.

Brenda will face Democratic candidate Mary Renfro in the general election, according to the AP.

Updated at 9:54 p.m.