Investment bank JPMorgan upgraded its recommendation for Cisco Systems to overweight and raised its price target for the network equipment maker on expectations of a rebound in public sector spending and improved margins in 2012.

Cisco stock was up 3.4 percent to $18.65 in midday trading in New York on Tuesday.

Our proprietary analysis of 30 U.S. federal agency budgets implies that spending will increase in FY'12 after being down in FY'11 and may act as a tailwind for Cisco, JPMorgan analyst Rod Hall said in a note.

As a result, we believe Cisco represents a relatively safe haven for communications equipment investors, Hall added.

JPMorgan raised its price target for Cisco shares to $21 from $19.

The problems Cisco encountered in 2011 were a number of small issues that resulted in a year-on-year decline in gross margins, Hall said, adding that it was not likely to happen this year because those problems have been addressed by the company.

(Reporting By Nicola Leske; editing by John Wallace)