CARACAS, Venezuela—Goldman Sachs Group Inc. bought about $2.8 billion in Venezuelan bonds that had been held by the oil-rich country’s central bank, a lifeline to President Nicolás Maduro’s embattled government as it scrambles to raise funds in the midst of widening civil unrest.

The New York-based bank’s asset management division last week paid 31 cents on the dollar, or about $865 million, for bonds issued by state oil company Petróleos de Venezuela SA in 2014, which mature in 2022, according to five people familiar with...