Analysts in a Bloomberg News poll had forecast a rate of 3.4 percent. Prices of pork, the staple meat in China, have more than doubled in the past year, according to the NBS.
More than a million pigs have been culled due to the widespread outbreaks since African swine fever appeared in August 2018, according to official statistics, but that is widely considered to be an underestimate.
This, in turn, has also pushed up prices of other meats including beef, chicken, duck and eggs as consumers switch to other protein sources.
The spike has led the government to intervene to stabilise prices and guarantee supplies, according to the official Xinhua news agency.
"Chinese leaders are terrified of inflation," Beijing-based research firm Trivium China said in a note, describing price rises as "one of the big drivers behind the 1989 Tiananmen protests".
The inflation rate at the time of the student-led uprising stood at 18.25 percent.
Producer prices, meanwhile, saw their steepest decline in more than three years, sliding for a sixth straight month, hit by the trade war with the United States.
The producer price index (PPI) - an important barometer of the industrial sector that measures the cost of goods at the factory gate - contracted 1.6 percent in October from the previous year, the NBS said.
That came after prices shrank 1.2 percent in December, and represented the sharpest decline since August 2016.
Analysts in a Bloomberg poll had forecast producer prices would shrink 1.5 percent.