The D.C. Court of Appeals struck down as unconstitutional yesterday a city law that requires paternity suits be filed within two years.

City lawyers and welfare officials immediately hailed the ruling, saying it will aid, in numerous cases, efforts to force fathers to help pay the costs of bringing up children born out of wedlock.

"The two-year limit is not only difficult for us to deal with, it is unfair to the child," said Audrey Rowe, commissioner of social services.

Under the court ruling, attorneys now will have at least three years to file suits to determine parentage in disputed paternity cases.

City lawyers frequently bring such suits in an effort to further aid unmarried women on public assistance. Officials nationwide have, over recent years, stepped up efforts to locate the fathers of children born out of wedlock to offset the cost of supporting the mothers with public funds.

Rowe said her office will now comb its records in an effort to find cases that could not be pursued or were dismissed because the two-year limit had lapsed. The limit in the past had frequently made it difficult, Rowe said, to bring cases in court because the fathers' whereabouts often are unknown.

The ruling involves a case in which the D.C. corporation counsel had brought suit on behalf of a woman seeking financial support from the man she claimed was the father of her two children.

A lower court judge dismissed the suit because the two-year limit had run out.

Attorneys for the woman appealed, arguing that the statute of limitations in such cases, requiring that paternity suits be brought within two years of a child's birth, "discriminated impermissibly against children born out of wedlock, thereby denying them equal protection of the laws."

A three-judge appellate panel ruled that the law does violate equal protection provisions of the constitution. In writing the court's opinion, Judge James A. Belson cited Supreme Court decisions dating to 1968 in which the rights of illegitimate children are outlined.

Among those decisions was a ruling striking down a similar paternity law in Texas, which required that suits to determine parentage be brought within one year of birth.

Belson noted that the city's attorneys may not initiate paternity proceedings in such cases until the mother applies for public assistance, and that mothers frequently do not apply for assistance until the two years has run out.

"Unfortunately, it is the child, not the parties who failed to undertake timely action on his behalf, who suffers as a result," Belson wrote. "The statute. . . tends to defeat the goal of protecting the child's welfare."