Gonen Segev, a former Israeli minister who was found to have met repeatedly with Iranian intelligence officials for the past six years and given them sensitive information, will serve 11 years in prison as part of a plea bargain deal, according to the Jerusalem District Court on Wednesday.

Segev, Israel’s former Minister of Energy and Infrastructure, admitted to reduced security-related offenses in exchange for the charge of assisting an enemy in wartime being stricken from the indictment, despite that the fact that he traveled twice to Tehran on a non-Israeli passport, according to Shin Bet security services.

Segev, who had been living in Nigeria since serving time for drug-smuggling in 2007, was extradited to Israel from Equatorial Guinea in May.

He was charged with trying to lure Israeli defense, security and infrastructure experts to Nigeria under the guise of securing business relationships with Nigerian authorities, when the meetings were in fact made with Iranian agents, according to Hadashot news.

Some of the Israeli experts suspected foul play and alerted Israeli security services, who began investigating Segev.

According to the charge sheet, “The defendant gave the Iranians secret information with the intention of harming state security. Among other things, the information included the location of security installations, the names of security personnel and more. The accused also gave the Iranians dozens of pieces of information in order to harm state security.”

Prosecutors said he also performed various missions for Iran, though the details were redacted.

Segev’s attorneys said he was attempting to serve as a double agent against Iran, with the hopes of providing critical information to Israel and returning home a hero.

An official sentencing hearing will take place on Feb. 11.