The economy expanded 6.9 percent in April-June, the same as the previous three months and better than the 6.8 percent tipped in an AFP survey.
"The national economy has maintained the momentum of steady and sound development in the first half of 2017, laying a solid foundation for achieving the annual target and better performance," national statistics bureau spokesman Xing Zhihong said.
"However, we must be aware that there are still many unstable and uncertain factors abroad and long-term structural contradictions remain prominent at home," Xing told reporters.
Industrial production grew 7.6 percent in June while retail sales were up 11 percent, both better than the previous month, according to the official data.
But analysts expect a deceleration of the overall economy.
"China's strong first half to the year won't last," Julian Evans-Pritchard, China economist at Capital Economics, said in a note.
"The recent crackdown on financial risks has driven a slowdown in credit growth, which will weigh on the economy during the second half of this year," he said.