BUDAPEST (Reuters) - The U.S. envoy to Budapest sharply criticised the Hungarian government on Tuesday for close political and business relations with China that often "come with strings attached, and the interest is often paid in sovereignty."

In a speech to U.S. companies that have invested in Hungary, at the American Chamber of Commerce, Ambassador David Pressman slammed Hungary for doing business with China based on non-transparent contracts "rife with corruption."

He also criticised nationalist Prime Minister Viktor Orban's government for allowing Chinese workers into Hungary and for a security cooperation between the two countries that allows for the presence of Chinese police officers in Hungary.

Pressmann said the United States also does business with China, but "transparently, based on clear rules, and with due concern for the security interests of our Allies."

Relations between Budapest and Washington have soured because of Hungary's foot-dragging over the ratification of Sweden's NATO accession - finally passed by Budapest in February - and also over Orban's warm ties with Moscow despite the war in Ukraine.

"We all know that Hungary cannot, for long, have it both ways. To benefit from being in the community of democratic nations, but not constrained by it. To exercise the rights, but not always the responsibilities," Pressmann said.

Pressmann's criticism comes a month after Chinese President Xi Jinping visited Hungary, his third and final stop on hiss first European visit in five years, and called the China-Hungary relationship and "all-weather strategic partnership."

Hungary under right-leaning Orban has become an important trade and investment partner for China, in contrast with some other EU nations that are considering becoming less dependent on the world's second-largest economy.

(Reporting by Anita Komuves; Editing by Leslie Adler)