* Delay in Senate came on dissent by Senator Rand Paul
* Measure goes next to House, where passage uncertain
* Package extends debt ceiling, could help calm markets (Adds vote tally, background)
WASHINGTON, Feb 9 (Reuters) - The U.S. Senate approved a budget deal including a stopgap government funding bill early on Friday, but it was too late to prevent a federal shutdown that was already underway in an embarrassing setback for the Republican-controlled Congress.
The shutdown, which technically started at midnight, was the second this year under Republican President Donald Trump, who played little role in attempts by party leaders earlier this week to head it off and end months of fiscal squabbling.
The U.S. Office of Personnel Management advised millions of federal employees shortly after midnight to check with their agencies about whether they should report to work on Friday.
The Senate's approval of the budget and stopgap funding package, by a vote of 71-28, meant it will go next to the House of Representatives, where lawmakers were divided along party lines and passage was uncertain.
House Republican leaders on Thursday had offered assurances that the package would be approved, but so did Senate leaders and the critical midnight deadline, when current government funding authority expired, was still missed.
The reason for that was a nine-hour, on-again, off-again Senate floor speech by Kentucky Republican Senator Rand Paul, who objected to deficit spending in the bill.
The unexpected turn of events dragged the Senate proceedings into the wee hours and underscored the persistent inability of Congress and Trump to deal efficiently with Washington's most basic fiscal obligations of keeping the government open.
The shutdown could be brief. If the House acts before daybreak to approve the package from the Senate, there would be no practical interruption in federal government business.
If it does not, the result would be an actual shutdown, the second of 2018, after a three-day shutdown in January.
Paul said during his marathon speech, which strained fellow senators' patience, that the two-year budget deal would "loot the Treasury."
The bill would raise military and domestic spending by almost $300 billion over the next two years. With no offsets in the form of other spending cuts or new tax revenues, that additional spending would be financed by borrowed money.
MORE RED INK
The budget part of the package was a bipartisan attempt by Senate leaders to end for many months, at least beyond November's midterm congressional elections, the fiscal policy quarrels that increasingly consume Congress.
But the deficit spending in the bill would add more red ink to Washington's balance sheet and further underscore a shift in Republican thinking that Paul was trying to draw attention to.
Once known as the party of fiscal conservatism, the Republicans and Trump approved a sweeping tax overhaul bill in December that will add an estimated $1.5 trillion to the $20 trillion national debt over 10 years.
"I ran for office because I was very critical of President Obama's trillion-dollar deficits," Paul said.
"Now we have Republicans hand in hand with Democrats offering us trillion-dollar deficits. I can't ... in good faith, just look the other way because my party is now complicit in the deficits. Really who is to blame? Both parties," he said.
Paul voted for the deficit-financed tax bill in December.
The shutdown in Washington came at a sensitive time for financial markets. Stocks plunged on Thursday in New York on heavy volume, throwing off course a nearly nine-year bull run. The S&P 500 slumped 3.8 percent.
Markets barely flinched at the last shutdown in January, but that was before a dizzying selloff that started on Jan. 30 amid concerns about inflation and higher interest rates.
Uneasiness in the markets could be partially reduced by another part of the Senate bill, which would extend the federal debt ceiling to March 2019, preventing further confrontations over that volatile issue in Congress for more than a year.
But final passage of the bill was still uncertain, with House Democratic leader Nancy Pelosi and others in her party opposing it because Republican House leaders will not guarantee her that they will allow a debate later on about taking steps to protect about 700,000 "Dreamer" immigrants from deportation.
The young people were brought illegally to the country as children years ago, mostly from Mexico.
Trump said last September he would end by March 5 a program set up by former Democratic President Barack Obama to protect the Dreamers from deportation, and urged Congress to act before then. Senate Republicans have pledged to hold a separate immigration debate this month.
Even without Pelosi, the House could pass the budget bill because it includes more money for disaster relief, infrastructure and healthcare, which many Democrats favor.
But some House Republican conservatives, like Paul, have criticized the bill's deficit spending.
House Speaker Paul Ryan, who backs the bill, predicted the Republican-controlled House would pass it. "I think we will," he said in a radio interview. "It's going to need bipartisan support. We are going to deliver our share of support."
(Additional reporting by Eric Beech, Makini Brice, Katanga Johnson and Doina Chiacu; Writing by Kevin Drawbaugh; Editing by Matthew Mpoke Bigg)