Google’s Larry Page and Sergey Brin are raiding the search giant’s piggybanks for $1.77 billion in cash and will officially own 111 Eighth Avenue on Wednesday after the mortgage is cancelled.

The Mountain View, Calif., company’s final cost, including transfer taxes and assorted other fees, could be close to $1.9 billion.

The pre-closing for the jumbo, 18 story, 2.9 million square foot, tech-stuffed building — which takes up a full block in Chelsea bounded by Eighth and Ninth avenues and 15th and 16th streets — took place over Thursday and yesterday, sources told The Post.

Investment broker Douglas Harmon of Eastdil Secured marketed the building, which is 98.7 percent leased, for Taconic Partners, Jamestown and the New York State Common Retirement Fund. Sources said Taconic will remain as the building’s manager.

Google, which occupies 550,000 square feet there, was guided by a CB Richard Ellis team of Darcy Stacom, Bill Shanahan and Steve Siegel to beat out a host of competing bidders.

“There were a bunch of global investors salivating over the building, but at the end of the day, a corporate user can always pay more than an investor,” commented Dan Fasulo of Real Capital Analytics, which compiles commercial real estate data.

The closing documents will remain in escrow until the $500 million Greenwich Capital mortgage is “defeased” — that is, taken out of a $2.6 billion mortgage pool compiled in 2004.

The cost of the defeasance alone could be as much as an additional $75 million for Google, sources said, as the interest stream from the one mortgage has to be replaced with other income, typically US Treasuries.

The Art Deco building is a former Port Authority of New York and New Jersey industrial property and has numerous back-up generators, lots of electrical power, antennas, fiber optics and high-tech facilities available to tenants.