The campaign arm for House Republicans was hacked during the 2018 election cycle, exposing sensitive emails.

National Republican Congressional Committee spokesman Ian Prior confirmed Tuesday that the "cyber intrusion" was by an "unknown entity."

An internal investigation and an FBI investigation into the attack are ongoing.

The hacked accounts belonged to four senior aides of the NRCC, Politico reported. The attack was detected by a cybersecurity vendor in April.

House GOP leaders, including Speaker Paul Ryan of Wisconsin, were unaware of the attack until they received questions about it this week, Politico reported.

NRCC officials told Politico that information about the hack was withheld so as not to compromise the investigation. Officials said none of the compromised information has been made public.

This year, Rep. Steve Stivers, R-Ohio – who served as committee chairman this election cycle – said the NRCC hired cybersecurity staffers.

"We’re starting to advise campaigns, but we’re not ready to roll the whole thing out. We’re working on it," Stivers said in March, according to The Associated Press. "We’re working on the technology-based stuff to try and make sure that we know what’s out there – which is hard, too – and then we try to defend against it the best we can."

During the 2016 election cycle, the Democratic National Committee was hacked, allegedly by Russian operatives in an effort to hurt the presidential campaign of Hillary Clinton. The hacked emails were published by WikiLeaks, an action that is being investigated by special counsel Robert Mueller as he looks into Russian interference in the 2016 election.

In the aftermath of the hack, the DNC was criticized for not heeding warnings from U.S. intelligence agencies to better protect its systems and taking stronger cybersecurity measures.