Network equipment maker Cisco Systems Inc CEO John Chambers stunned investors for the third time in as many quarters, warning of worsening government spending.

The company's weak gross margins and a weaker-than-expected profit forecast for the current quarter also added to worries that the leading manufacturer of routers and switches was facing tough competition from rivals like Hewlett-Packard Co.

Cisco shares fell 10 percent after hours, dragging down the stock of peers such as Juniper Networks Inc, F5 Networks Inc and Riverbed Technology Inc.

Investors had also been spooked last quarter when Cisco blamed a weak outlook on weak orders from debt-burdened clients in the public sector, and Chambers didn't offer much of a relief this quarter either.

Unfortunately, we believe that our concerns in the public sector will continue to be challenging in the developed world for the next several quarters, he said, adding that Cisco's government accounts in the United States, Europe and Japan had all been hit in the second quarter.

The challenges at state, local, and eventually federal level in our opinion will worsen over the next several quarters, he said of the U.S. market.

Cisco's second-quarter gross margin fell to 62.4 percent from 64.3 percent a year earlier, confirming analysts' concerns that growing competition may be forcing the company to cut prices to protect market share.

The results were a little bit better than expected on the top line and also better on the bottom with some help from a better tax rate. However, investors are looking at the gross margins, which declined sequentially, said RBC Capital Markets analyst Mark Sue.

Chambers pledged to form a working group to improve margins and safeguard against market share erosion.

Cisco's fiscal second-quarter revenue rose 6 percent from a year earlier to $10.41 billion. Analysts had expected $10.23 billion, according to Thomson Reuters I/B/E/S.

The company's net profit for the quarter ended January 29 fell to $1.5 billion from $1.9 billion a year earlier. Excluding items, its earnings per share was 37 cents, beating the market's average forecast of 35 cents and Cisco's own forecast of 32-35 cents.

The company forecast third-quarter profit per share, excluding items, would range from 35 to 38 cents, below Wall Street expectations of 40 cents.

Cisco forecast revenue in its fiscal third and fourth quarters within range of Wall Street estimates, failing to pull its shares higher.

The company expects revenue for the current third quarter to rise by 4 to 6 percent. It sees fourth-quarter revenue growing 8 to 11 percent. Wall Street analysts estimate 5 percent growth for the third quarter and an 8 percent rise for the fourth.

Cisco is considered one of the sector's prime bellwethers due to the breadth of its customer base which ranges from small U.S. businesses to foreign governments. Also, its last quarter ended in January rather than December like most of its peers, making its results a more up-to-date indicator of technology spending.

(Reporting by Ritsuko Ando; Editing by Richard Chang)