Michael O'Neill has been appointed as manager of Stoke City but will take charge of Northern Ireland for any potential Euro 2020 play-off games.
He will take over at the Championship's bottom club immediately and will manage Northern Ireland for their final two qualifiers and any play-off in March.
O'Neill, 50, succeeds Nathan Jones, who was sacked by Stoke on 1 November.
He guided Northern Ireland to Euro 2016 and the brink of the 2018 World Cup during his eight-year reign.
- In pictures: O'Neill's time as Northern Ireland manager
- How much do you remember about his O'Neill's reign?
- The man who put the pride back into Northern Ireland's team
The former Shamrock Rovers boss, who was appointed by the Irish FA in December 2011, met with the Stoke players on Friday morning and took training, and will travel with the team for Saturday's match away to Barnsley.
"We reluctantly agreed to allow Stoke to talk to Michael after they met the compensation requirements. Michael has now agreed terms with the EFL Championship club," Irish FA chief executive Patrick Nelson said.
"Naturally, we are extremely disappointed that Michael is leaving us, however we are delighted all parties have agreed Michael will be in charge of the Northern Ireland team for the games against the Netherlands and Germany and potential Euro 2020 play-off matches next March.
"Everyone in the GAWA [Green and White Army] family is grateful for Michael's inspirational contribution over the past eight years."
On Thursday morning the Irish FA said Stoke had asked for permission to speak to O'Neill.
After narrowly missing out on a place at last year's World Cup following an unlucky play-off defeat by Switzerland, O'Neill's Northern Ireland made a strong start to their Euro 2020 qualifying campaign.
They won their opening four matches but have dropped to third in Group C following defeats by Germany and the Netherlands.
O'Neill will be in charge for the two final qualifiers against the Dutch and Germans later this month but, regardless of those results, a play-off place seems likely.
Motherwell boss Stephen Robinson and Northern Ireland Under-21 manager Ian Baraclough are likely to be among the contenders to replace O'Neill.
Stoke bottom of Championship after only two wins
O'Neill is expected to be at Oakwell on Saturday for Stoke's game against fellow strugglers Barnsley before returning to Northern Ireland duties.
Stoke sit bottom of the Championship having won only two of their opening 15 games.
O'Neill's Stoke backroom team is expected to include his former Northern Ireland assistant Billy McKinlay and ex-Newcastle keeper Steve Harper, who is the current Northern Ireland goalkeeping coach.
O'Neill is expected to almost double his £750,000 Northern Ireland salary by taking the Stoke job and is believed to have been promised significant resources to spend during the January transfer window.