SAN JOSE, Calif. (AP) _ Hewlett-Packard Co., responding to an Apple Computer Inc. copyright infringement suit, countersued in federal court Wednesday alleging unfair business practices and antitrust violations by Apple.

Hewlett-Packard, based in Palo Alto, also denied all of Apple's allegations and asked the U.S. District Court in San Jose to invalidate Apple's copyrights in the case and dismiss its suit against Hewlett-Packard.

''HP is confident the court will agree Apple's suit has no merit,'' said Douglas C. Chance, executive vice president of HP's Business Systems Sector.

Apple officials were unavailable for comment on the Hewlett-Packard countersuit when the company was contacted Wednesday.

Cupertino-based Apple sued Hewlett-Packard and Microsoft Corp., of Redmond, Wash., in March, charging them with copyright infringement in two so-called ''operating environment'' programs - Microsoft's Windows and Hewlett- Packard's NewWave.

Operating environment programs provide a visual ''desktop'' on the screen, on which a computer user can view various symbols representing documents, applications programs and places to store information.

Apple's suit shook software developers and computer makers throughout the industry because of its potential scope. Besides taking aim at Hewlett-Packard and Microsoft, Apple also indirectly challenged its biggest rival, International Business Machines Corp., which has been incorporating display graphics similar to Apple's.

Apple was seen as essentially asking the court to preserve a technological edge it has enjoyed over its competitors, who were starting to close the gap.

Microsoft countersued in April, seeking unspecified damages on the grounds that Apple violated contracts, acted in bad faith and damaged Microsoft's relations with other companies.

Microsoft denied that its Windows product infringed on Apple copyrights by using images that too closely resembled those of Apple's popular Macintosh computer.

Hewlett-Packard claimed in its countersuit that Apple did not hold valid copyrights for the visual displays and images because Apple did not originate them.

''By claiming sole authorship of those displays and images, Apple misled the U.S. Copyright Office in order to stifle competition and hamper HP, Microsoft and others from entering a market - graphical user-interface operating environments for personal computers - that Apple dominates,'' Hewlett-Packard said in a statement about the suit.

Hewlett-Packard also said, ''Apple misled the court and the public by altering Hewlett-Packard screen images to create the false impression that they are similar to the Apple Macintosh.

''HP believes Apple's real concern is not that some features of HP NewWave resemble those of the Macintosh, but that HP NewWave delivers what Apple itself has described as its vision of the future.''