U.S. stocks rose Thursday, with the Nasdaq Composite Index reaching a record, after Greek lawmakers passed a bailout deal while companies including Netflix, Google and Citigroup rallied on earnings.

Netflix jumped 18 percent after subscribers surged in the second quarter, beating projections. EBay climbed 3.4 percent after quarterly sales exceeded estimates and it agreed to sell its enterprise unit for $925 million. Citigroup added 3.8 percent as cost cuts helped the bank's quarterly profit beat analysts' estimates. Google rallied in late trading after its earnings were better than estimated.

The Nasdaq composite increased 1.3 percent to 5,163.18, topping its closing record set on June 23. The Standard & Poor's 500 index rose 0.8 percent to 2,124.29, 0.3 percent below its record. The Dow Jones industrial average gained 70.08 points, or 0.4 percent, to 18,120.25. About 6.2 billion shares traded hands on U.S. exchanges, 3.6 percent below the three-month ­average.

"It looks like the equity market likes the Greek settlement," said Ron Anari, the Jersey City, N.J.-based senior vice president of trading at ICAP. "At this stage of the game, the Federal Reserve is in the driver's seat, we're going to see a hike sometime in September, and the equity market understands that. It's expecting more positive economic news."

Greek lawmakers passed reform measures demanded by creditors in exchange for negotiating a third bailout package. Following the vote, European Central Bank President Mario Draghi said Thursday that the central bank raised the level of emergency aid to Greek lenders.

The S&P 500 is on pace for its biggest weekly gain in four months, as it closes in on its May 21 record. The gauge fell as much as 4 percent from that level amid concern the Greek debt crisis and China's equities rout would hurt global growth as the Federal Reserve considers raising interest rates this year.

Fed Chairwoman Janet ­Yellen appeared Thursday before the Senate Banking Committee in Washington, continuing her semiannual testimony on monetary policy. She told lawmakers that raising rates too late holds risks, along with tightening too quickly.

On Wednesday, Yellen signaled the Fed is on track to raise rates this year, while emphasizing that the timing of the first rate rise is less important than the subsequent path of increases, which she said would be gradual.

Policymakers are watching for further improvement in the labor market.