The NFL Network quoted sources that said O'Brien agreed to the deal right at the deadline the Texans had set.
O'Brien led Penn State to a 15-9 record in his two seasons, with his final game an upset victory at Wisconsin. More important, he stabilized a program that could have fallen apart after NCAA sanctions were imposed in response to the Jerry Sandusky child sex-abuse scandal.
But O'Brien, a former New England assistant who flirted with the Eagles and Cleveland a year ago before remaining at Penn State, wanted to become an NFL head coach, and said his first responsibility was to his family to check out any opportunities.
The Texans, who fired Gary Kubiak as coach on Dec. 6, met with O'Brien Thursday at O'Brien's home on Cape Cod and reports surfaced that they would try to get a deal done as soon as possible. Team chairman Bob McNair also interviewed former Chicago Bears coach Lovie Smith and interim Houston head coach Wade Phillips, but O'Brien was his man all along.
The decision was believed to be a difficult one for O'Brien. His first recruit, quarterback Christian Hackenberg, stayed with his pledge even after the NCAA sanctions came out and had one of the finest seasons of any freshman in the country in 2013. Hackenberg's father told the Harrisburg Patriot-News over the weekend that he was "comfortable" with what O'Brien told his son but did not disclose what that was.
In addition, the Nittany Lions have a recruiting class for 2014 ranked in the top 20 by most recruiting websites. One recruit, four-star defensive tackle Thomas Holley, said O'Brien told him on Saturday that he was staying at Penn State.
Led by athletic director Dave Joyner, the university will need to act quickly to hire a new coach, keep the current staff intact, and hold on to the recruits.
Among the candidates mentioned are head coaches Mike Munchak of the Tennessee Titans, Al Golden of the University of Miami, and James Franklin of Vanderbilt, as well as fired Tampa Bay head coach Greg Schiano and former Indianapolis Colts head man Jim Caldwell.
Munchak, a former Penn State star, is expected to learn his situation at a meeting with team officials later this week. Golden also played at Penn State, and Schiano and Caldwell are former assistants.
Among Twitter postings by players after the O'Brien news was made public came one from defensive end Deion Barnes, the former Northeast High star.
"It's crazy that I've been with PSU for 3 years now and I'm going to have 3 different coaches," Barnes wrote. "We've been through it all and we gonna keep it up."
O'Brien, who was offensive coordinator for the last of his five years with the Patriots, accepted the Penn State job on Jan. 6, 2012, two months after Sandusky was indicted.
In July of that year, the NCAA stripped the Nittany Lions of scholarships, relaxed transfer rules so that any player who wanted to leave Penn State could do so without having to sit out a year, and prevented the team from participating in postseason play for four years.
But O'Brien kept his team together for the most part with the help of a dedicated senior class, and urged the Penn State community to look ahead rather than point fingers at the NCAA. Aided by a report from former Sen. George Mitchell, who became the university's athletics monitor after the sanctions, the NCAA restored some of the team's scholarships last September.
Penn Staters for Responsible Stewardship, an alumni and student group, had praise for the outgoing coach.
"There's no denying Bill O'Brien came to Penn State at a critical time, and he has certainly earned his place in Penn State's history," said Maribeth Roman Schmidt, a spokeswoman for the group.
"He gave us two seasons we will never forget, and provided a much needed beacon during the darkest days we've ever known."