BEIJING (Reuters) - Chinese police on Thursday released on bail a legal assistant who worked for a prominent human rights lawyer after almost a year in detention on subversion charges, as the visiting U.N. secretary general called on China to respect civil society.

China's leadership has overseen a sweeping crackdown on activists since President Xi Jinping took power, including detaining or imprisoning dozens of rights lawyers in what the government says is the targeting of criminal acts.

In a brief statement on their official microblog, police in the eastern city of Tianjin said Zhao Wei would be freed on bail given her good behavior and after she had confessed to her crime and for her "relatively good attitude".

Zhao, 24, an assistant for the prominent detained lawyer Li Heping, was detained last July.

She was released mid-afternoon, a person close to her told Reuters, asking not to be identified.

The Tianjin police declined to comment when contacted by telephone. Reuters was unable to reach Zhao for comment.

China consistently rejects any criticism of its human rights record, saying it adheres to the rule of law. Nonetheless, the crackdown has alarmed Western governments.

Speaking to reporters after meeting Foreign Minister Wang Yi, U.N. Secretary-General Ban Ki-moon said he had personally witnessed China's contributions to the United Nations and all its great successes.

"As China continues along the path of transformation and reform, I encourage China's leaders to create the space needed for the civil society to play its crucial role," Ban said, mentioning environmental activists and human rights lawyers.

"Along with free and independent media, it can help ensure accountability, thereby helping the state to be more effective and strengthening its standing in the eyes of the people," he added.

"The world will look to China to complement its remarkable economic advances by giving citizens a full say and a role in the political life of their country."

Wang, standing to Ban's side, did not comment on the country's human rights record.

(Reporting by Ben Blanchard and James Pomfret)