Gov. Mike Dunleavy signed legislation Thursday that unlocks hundreds of millions of dollars in federal aid and restores funding to the state’s college scholarship funds and rural power subsidy program. Before putting his signature on the bill in blue pen, though, Dunleavy used a red pen to veto millions from the bill.

The $34.7 million cut from Senate Bill 2002 would have funded addiction treatment, earthquake monitoring and homeless assistance, among other programs. Beside the governor’s signature on the bill’s final copy, the printed words “approved by the governor” were amended with a neat handwritten note that read: “with line item vetoes."

In a ceremony outside the Associated General Contractors office in Anchorage, Dunleavy emphasized the bill’s positive aspects, saying it is “a cause for celebration,” albeit one tempered by the death Wednesday of state Sen. Chris Birch, R-Anchorage.

SB 2002 was a critical piece of legislation required by the staunch position of the Republican House minority in favor of a $3,000 Permanent Fund dividend.

The minority declined to fund the state’s capital budget from the Constitutional Budget Reserve until the Legislature first approved a dividend paid using the traditional formula.

When the coalition House majority declined to vote in favor of that plan, the capital budget went unfunded, and on July 1, 54 separate state savings accounts were automatically swept into the budget reserve under a clause of the state constitution. That sapped more than $115 million from the state operating budget, including money intended to pay for the Alaska Performance Scholarship program and the state’s Power Cost Equalization program.

The AGC, home to Thursday’s ceremony, was among the organizations that urged legislators to address the issue. (AGC is the former employer of Alaska Department of Transportation Commissioner John MacKinnon, who stood behind Dunleavy as he signed the bill.)

The bill had passed the Senate 19-0 and the House 31-7 after some minority Republicans changed their positions. It includes the “reverse sweep” clause needed to fix the automatic sweep. It also funds the capital budget with enough money to unlock $877 million in federal aid for highways and airports. The bill includes $12 million needed to match $52 million in grants for rural water and wastewater programs, and it includes $2.54 million for a mental health unit at Hiland Mountain Correctional Center.

“Today’s action represents only one part of the equation — a properly funded capital budget that we see as significant progress for fulfilling our commitments to Alaskans, encouraging growth within our economy, and working together on moving forward,” the governor said in his prepared remarks at the signing ceremony. “After extended debate on the capital budget, the Legislature came together to adequately capture nearly a billion dollars in federal highway, transportation and infrastructure dollars, as well as clean water programs.”

The governor’s goal has been to balance the state budget without reducing the Permanent Fund dividend or raising taxes. Because the state’s savings accounts have dwindled, that means cutting services.

In June, Dunleavy vetoed $10.8 million from the unfinished capital budget. SB 2002 would have reversed those vetoes as well as vetoes to capital projects in the state’s mental health budget.

On a few items, Dunleavy reversed his earlier decisions to cut. For example, an appropriation of $2.2 million to deal with abandoned oil wells was signed into law Thursday after a June veto. The governor also kept money for school construction and maintenance in the Northwest Arctic Borough and plans for a new moorage facility in Ketchikan.

Lawmakers didn’t get everything they proposed in the bill, however, as the governor on Thursday revealed he had again vetoed some projects.

A $4 million appropriation for natural gas storage tanks in North Pole was again vetoed, as was money for improved ship tracking and trail cleanup on Flattop Mountain.

The governor also vetoed projects that didn’t make it to his desk in June because of the funding failure.

The governor halved funding for homelessness-assistance grants funded by the Alaska Housing Finance Corp. and eliminated a $5 million line item intended to help Alaskans insulate their homes. The corporation declined to comment on the impact of the vetoes Thursday and said they needed more time to sort through the cuts.

Another veto eliminated a $2.5 million grant to pay for some of the seismic sensors already installed by the National Science Foundation.

The foundation spent $50 million to install more than 150 seismic sensors across Alaska in recent years, vastly improving the state’s limited seismic network, officials with the Alaska Earthquake Center have said.

But it’s a short-term project, and the sensors are slated for removal in 2020. The Alaska Earthquake Center at the University of Alaska Fairbanks sought funding to take over the sensors before they disappear.

“(The National Science Foundation) was willing to sell it to us at a steeply discounted price … It’s state-of-the-art earthquake monitoring,” said Natalia Ruppert, a seismologist with the earthquake center. “It would have saved the state a lot of money, rather than install it from scratch sometime down the road.”

The earthquake center received funding from the United States Geological Survey to keep 43 sensors that are clustered around population centers in Southcentral, Interior and Southeast Alaska.

The University of Alaska requested $5 million from the state to keep 40 or so sensors in northern and Western Alaska, as well as in the Brooks Range, Ruppert said. The Legislature approved half of that request, which Dunleavy vetoed.

The removal of sensors in remote parts of the state means the earthquake center won’t be able to report earthquakes as quickly and accurately, Ruppert said.

Dunleavy’s biggest veto is $10 million in matching grants for new addiction-treatment facilities statewide. Those grants would have been paired with money from other sources, said Sen. Natasha von Imhof, R-Anchorage.

Von Imhof is treasurer of the Rasmuson Foundation board of directors and co-chair of the Senate Finance Committee in charge of the capital budget.

She said she didn’t understand the veto given Dunleavy’s focus on crime.

“We’ve heard from experts that a large part of the crime increase is related to drugs, people stealing money or goods to buy drugs," she said. "And the treatment option, to me, is a targeted approach to get to the root of crime.

“Apparently the governor disagrees.”

What’s in the budget

According to a list of items provided by the Office of Management and Budget:

• $73 million for highways and airports, which secures $877.2 million in federal funds

• $12 million for rural water and wastewater projects, unlocking over $52 million in federal aid

• $7.4 million for tourism marketing by the Alaska Travel Industry Association

• $2.54 million to Hiland Mountain Women’s Mental Health Unit

• $2 million for Northwest Arctic Borough school construction and major maintenance

• $2.5 million for the state’s Arctic Strategic Transportation and Resources program, which involves North Slope planning

• $1.5 million for the AHFC Rental Assistance for Victims Program

• $3.6 million for the AHFC Homeless Assistance Program

• $1.75 million for AHFC senior citizen housing

• $250,000 for the Inter-Island Ferry Authority

• $13.5 million for Alaska Marine Highway System vessel overhaul and certification needed to keep ferries running

• $1.6 million for the state’s Harbor Grant Program

The biggest vetoes

According to a list of vetoes provided by the Office of Management and Budget:

• $10 million matching grants for addiction treatment facility construction

• $5 million for insulating and weatherizing homes

• $4 million for a natural gas storage facility in North Pole

• $3.6 million for the AHFC Homeless Assistance Program, half of what was budgeted by the Legislature.

• $2.5 million for the USArray earthquake monitoring network

• $2.5 million for deferred maintenance at the University of Alaska (the Legislature and governor has already funded $5 million in deferred maintenance)

• $1.75 million for AHFC to build housing for teachers, health care workers and public safety workers

• $1 million for public transportation matching grants

The Daily News’ James Brooks reported from Juneau. Tegan Hanlon reported from Anchorage.