NEW YORK — Gov. Andrew Cuomo, fearing that a severe storm could wreak havoc with the city's power system, intervened in a labor dispute between the Consolidated Edison utility and its workers and brokered a tentative agreement Thursday after a weeks-long standoff.

"You don't want a storm hitting New York City without Con Ed being at full force," Cuomo said at a news conference announcing that an agreement had been reached.

Terms of the four-year agreement were not disclosed, since it must be taken back to the union's executive committee and membership and to Con Ed's board. But Cuomo said it was "a good deal, I believe, for both sides."

Workers greeted news of the agreement with caution.

"I am happy as long as it works out," said Bob Missing, who has worked for the company for 50 years. "I am about to retire so I am really concerned about our pensions."

City residents were glad the standoff seemed to be over.

"It took long enough," said Elba Mendez, of the Bronx. "Governor Cuomo should have gotten involved earlier. It is not only a storm that could affect us."

The previous contract between Con Ed and Local 1-2 of the Utility Workers of America had expired June 30, with Con Ed locking out about 8,000 employees just hours later. Among the points of contention had been pensions and health care.

The lockout continued even as high temperatures stifled the city on several days. But Thursday night was expected to bring severe thunderstorms, with damaging winds and hail, to the city and larger region.

That pushed Cuomo into getting involved, and he brought the sides together. Initially, an agreement was reached for half the locked-out employees to return to work temporarily, for the duration of any emergency and any following repairs.

The sides continued talking after that temporary agreement was reached, leading to the tentative contract agreement later Thursday.

Cuomo, a Democrat, credited the impending storm for its role in the dispute's resolution.

"Sometimes a storm has a silver lining," he said. "And I think this storm actually had a silver lining by bringing the parties together."

He spoke at his Manhattan office after personally overseeing several hours of negotiations between Con Ed officials, including President Kevin Burke, and union leadership.

Local 1-2 President Harry Farrell said the sides "never would have been able" to get the deal done without the governor's intervention.

"All of my members will be going back to work ASAP," he said.

Burke said Thursday was the first day that he was personally involved in the labor talks. He said Cuomo "has certain skills that help bring people together."

About 5,000 managers, former employees and contractors were keeping the power going for 3.2 million customers in New York City and Westchester County, just north of the city, during the lockout.

Loading Slideshow...
  • Locked-out workers demonstrate outside Consolidated Edison headquarters, in New York, Thursday, July 5, 2012. Consolidated Edison and the union representing its employees are returning to the bargaining table. Talks were scheduled to resume Thursday afternoon, while the picket lines in New York's Union Square grow. Pressure is mounting on both sides to resume negotiations after they failed last weekend. On Thursday, the company put out a full page ad blasting the union. (AP Photo/Richard Drew)

  • The son of a locked-out worker holds a sign outside Consolidated Edison headquarters, in New York, Thursday, July 5, 2012. Consolidated Edison and the union representing its employees are returning to the bargaining table. Talks were scheduled to resume Thursday afternoon, while the picket lines in New York's Union Square grow. Pressure is mounting on both sides to resume negotiations after they failed last weekend. On Thursday, the company put out a full page ad blasting the union. (AP Photo/Richard Drew)

  • Locked-out workers demonstrate outside Consolidated Edison headquarters, in New York, Thursday, July 5, 2012. Consolidated Edison and the union representing its employees are returning to the bargaining table. Talks were scheduled to resume Thursday afternoon, while the picket lines in New York's Union Square grow. Pressure is mounting on both sides to resume negotiations after they failed last weekend. On Thursday, the company put out a full page ad blasting the union. (AP Photo/Richard Drew)

  • Locked-out workers demonstrate outside Consolidated Edison headquarters, in New York, Thursday, July 5, 2012. Consolidated Edison and the union representing its employees are returning to the bargaining table. Talks were scheduled to resume Thursday afternoon, while the picket lines in New York's Union Square grow. Pressure is mounting on both sides to resume negotiations after they failed last weekend. On Thursday, the company put out a full page ad blasting the union. (AP Photo/Richard Drew)

  • Locked-out workers demonstrate outside Consolidated Edison headquarters, in New York, Thursday, July 5, 2012. Consolidated Edison and the union representing its employees are returning to the bargaining table. Talks were scheduled to resume Thursday afternoon, while the picket lines in New York's Union Square grow. Pressure is mounting on both sides to resume negotiations after they failed last weekend. On Thursday, the company put out a full page ad blasting the union. (AP Photo/Richard Drew)

  • Locked-out workers demonstrate outside Consolidated Edison headquarters, in New York, Thursday, July 5, 2012. Consolidated Edison and the union representing its employees are returning to the bargaining table. Talks were scheduled to resume Thursday afternoon, while the picket lines in New York's Union Square grow. Pressure is mounting on both sides to resume negotiations after they failed last weekend. On Thursday, the company put out a full page ad blasting the union. (AP Photo/Richard Drew)

  • A locked-out Consolidated Edison worker and union member rallies co-workers as they picket outside the company's headquarters in New York, Monday, July 2, 2012. Members of Local 1-2 of the Utility Workers of America protested as their leadership plotted its next move following failed contract talks and a lockout. A union spokesman said Harry Farrell, president of Local 1-2 of the Utility Workers of America, on Monday will call for federal mediators to intervene to get talks started again. (AP Photo/Kathy Willens)

  • Consolidated Edison distribution mechanic Lacey Craft uses a Con Edison traffic cone as a megaphone as he rallies workers during a picket outside the company's headquarters in New York, Monday, July 2, 2012 as managers entered the building. Members of Local 1-2 of the Utility Workers of America protested as their leadership plotted its next move following failed contract talks and a lockout. (AP Photo/Kathy Willens)

  • Consolidated Edison mechanic John Lucchini gets locked-out coworkers to react as they picketed outside the company's headquarters in New York, Monday, July 2, 2012. Members of Local 1-2 of the Utility Workers of America protested as their leadership plotted its next move following failed contract talks and a lockout. (AP Photo/Kathy Willens)

  • Locked out Consolidated Edison workers, including distribution mechanic Lacey Craft, center, react as managers left company's headquarters for a lunch break in New York, Monday, July 2, 2012. Members of Local 1-2 of the Utility Workers of America protested across the city as their leadership plotted its next move following failed contract talks and a lockout. (AP Photo/Kathy Willens)

  • Locked out Consolidated Edison workers shout out as company managers enter or leave the company headquarters in New York, Monday, July 2, 2012. Members of Local 1-2 of the Utility Workers of America picketed and protested noisily as their leadership plotted its next move following failed contract talks and a lockout. (AP Photo/Kathy Willens)

  • Consolidated Edison workers gather in front of a Con Ed building in New York, Monday, July 2, 2012. Unionized workers with Consolidated Edison in New York City will be picketing as their leadership plots their next move following failed contract talks and a lockout. (AP Photo/Seth Wenig)