Hungarian Communist Party leader Karoly Grosz is ending his groundbreakingvisit to Washington Thursday, calling it symbolic of the "new era of detente" and expressing hope that it will produce economic benefits for his country.

At a news conference Wednesday night, Grosz called the visit - the first by a Hungarian leader in 42 years - "an outstanding event in our relations."Grosz spoke a few hours after a meeting with President Reagan, who said he was encouraged by the Hungarian leader's recognition that his economic reform program "cannot succeed unless accompanied by political reforms as well."

Reagan also praised Grosz for his "openness to new ideas."

Grosz was to leave this morning aboard a U.S. presidential aircraft for Niagara Falls, N.Y. During his U.S. stay, he also visited Illinois, California and New York City.

He described the current era of detente as "much richer" and "much deeper" than the comparable period of the 1970's.

At 57, Grosz is from the same generation as Soviet leader Mikhail S. Gorbachev and his reform program has many similarities to the Soviet experiment.

Speaking through a translator at the Hungarian Embassy, Grosz said the accommodating atmosphere between East and West "provides not only the superpowers but the small and medium-sized powers with the opportunity to participate in a dialogue."