Federal prosecutors yesterday dropped remaining criminal charges against Computer Sciences Corp. and three individuals after the company agreed to pay the government $2.95 million and a former vice president pleaded no contest to two false claims charges involving a government contract.

The comprehensive settlement between the government and CSC ended a complicated 3-year-old case in which prosecutors alleged CSC, several of its officials and two current employes of a subcontractor filed inflated claims with the government in connection with a $158 million computer contract in the 1970s.

In May, after a trial in U.S. District Court in Alexandria, a jury acquitted the company, two of its officers and two officials of the subcontractor of charges they defrauded the General Services Administration in connection with that contract.

A second trial, involving 46 counts, including fraud and false claims charges, against CSC and four employes was to begin yesterday but was canceled after the settlement.

At a hearing before Judge Richard L. Williams, former CSC vice president John W. Luke pleaded no contest to the false claims charges and was immediately ordered to pay a $20,000 fine. The settlement of the case also barred Luke from any CSC contractual work with the government for at least three years.

Luke, who had been one of the four individuals acquitted of criminal charges in May, had been on administrative leave since his indictment in 1980. CSC announced later yesterday that Luke had resigned from the company on July 1.

Other criminal charges against Luke and three individuals were dropped as part of the agreement yesterday. It allows CSC to continue ongoing contracts with the federal government and bars any further legal action by the government in connection with the GSA contract.

CSC chairman and president William R. Hoover, in a statement, said the settlement "completely exonerates CSC from any wrongdoing." The $2.95 million payment, CSC officials argued, was not a penalty and bore out the firm's contention from the beginning that the case was a civil dispute, not a criminal one.

The government had contended it lost "in excess of $3 million" as a result of CSC's alleged acts.

Former CSC employe Erwin L. Allen, one of the individuals against whom all charges were dismissed yesterday, said he was "overjoyed" at the settlement. "Truth and justice prevailed," said Allen, who had been acquitted in May of criminal charges.

The case began with a 57-count indictment against the California-based firm and six individuals. It alleged false claims of money, wire fraud, mail fraud, conspiracy and racketeering in connection with the GSA contract.

The charges were thrown out by Williams in 1981 on the grounds of grand jury mistakes, but most were reinstated after an appeals court reversed Williams in 1982.

The four individuals acquitted in that trial were Luke; Allen; Herbert G. Blecker, president of Icarus Corp. of Maryland, which worked with CSC on the GSA contract; and Peter C. Loux, who left CSC to join Icarus.

The second trial would have involved CSC, Luke, Allen and CSC employes Thomas A. Marti and Norman W. Derrick. All charges yesterday also were dismissed against Marti and Derrick.

Charges of racketeering and conspiracy against the individuals, which were to be the subject of a third trial, also were dismissed as a result of the settlement.