Mr Cook said his decision "reflected the principled and brave stand" taken by the 14 after Margaret Thatcher banned union rights at GCHQ in Cheltenham in 1984 when she was prime minister.
The announcement marks an end to a campaign that has become a cause celebre in the Government's relations with trade unions.
The Foreign Secretary said the issue had been one of his priorities since he took office in May 1997 because the policy by the Thatcher government had been "wrong" and the 14 should not be "suffering" in their retirement because they had "stuck to their principles".
"The essential point for me and for the trade unions was whether we could distinguish between the 14 who were dismissed and others who left GCHQ. We are both now satisfied that a distinction can be made on behalf of those who took their principled stand," he added.
The amount of their compensation will depend on how long each of the 14 was serving at GCHQ and what grade they held. According to sources, three of the 14 were reinstated in government service, seven were past retirement age and the pension benefits of one had been brought forward on health grounds.
But they have accepted the terms of Mr Cook's decision and are said to be "delighted" that finally an end had been put to a "clear wrong" by the government of the time.
The ban was imposed at the height of Mrs Thatcher's battle against the trade unions during the mid 1980s. She claimed that civil servants' membership of the trade unions posed a "conflict of interest" with loyalty to the state, and that industrial action during the 1981 civil service pay strike had compromised the country's security.
Seven thousand staff were subsequently offered pounds 1,000 each in compensation and the 14 were eventually sacked for refusing to leave their union.
John Monks, the TUC general secretary, led trade union tributes, saying: "This finally closes a sorry chapter in British history. Robin Cook deserves great credit for righting this wrong."
John Sheldon, the general secretary of the Council of Civil Service Unions, said: "Compensating those trade unionists dismissed from GCHQ for the loss of their pension rights is the final step necessary to remedy the wrong done in January 1984. The announcement ensures that those brave trade unionists who stood out against the actions of the previous government even to the point of dismissal will not now suffer in their retirement as a con- sequence."
Mr Cook said his decision followed talks with the Council of Civil Service Unions and the TUC, which had reached "agreement in principle".
"This decision reflects the principled stand which the 14 trade unionists took, to the point of dismissal, against the attempt to take away their basic trades union rights," he said in a parliamentary written reply.
"The additional pensions benefits will be provided through a special scheme under the Superannuation Act 1972, which will be laid before Parliament once the details have been finalised."
Mr Cook added in a separate statement that the 14 "took a brave stand in the 1980s against a policy that was wrong.
"This agreement means that they will no suffer in their retirement for sticking to their principles," he added.Reuse content