Houston Rockets guard James Harden, left, drives to the basket past Dallas Mavericks guard Tim Hardaway Jr. (11) during the second half of an NBA basketball game, Monday, Feb. 11, 2019, in Houston. Houston won 120-104. (AP Photo/Eric Christian Smith)

Hampered by a strained left shoulder, James Harden nearly had his streak of consecutive 30-point games come to an end before coming alive down the stretch as the host Houston Rockets defeated the Dallas Mavericks 120-104 Monday.

Harden finished with a game-high 31 points on 9-for-23 shooting and rounded out his stat line with eight rebounds, seven assists and five steals.

The Rockets relied on a collective effort to build a lead against Dallas, with four others scoring in double figures, including guard Gerald Green, who poured in 19 points in 22 minutes off the bench while drilling 5 of 8 3-pointers.

After the Mavericks sliced what was once a 21-point deficit to 109-100 on a Jalen Brunson 3-pointer with 2:52 left to play, Harden drilled back-to-back treys to mute the rally.

Harden added two free throws and then hit another 3-pointer with 52.9 seconds left to give him 31 points and extend his streak to 30 games, the third-longest in NBA history.

Harden has paced the Rockets in scoring in every game since Dec. 1, a span of 35 contests.

Eric Gordon scored 18 points, while Chris Paul and Kenneth Faried added 17 apiece for the Rockets. Paul finished with 11 assists, moving past Hall of Fame guard Gary Payton for eighth place in league history.

Harden, Paul, and Gordon finished a combined 15 of 40 on 3-pointers.

Houston shot 23 of 60 from behind the arc.

Dallas rookie forward Luka Doncic posted 21 points, 10 rebounds, and eight assists to pace the Mavericks, who lost to the Rockets for the first time in three meetings this season.

Brunson tallied 13 points while Tim Hardaway Jr. scored 10 points, doing so on 3-of-11 shooting.

Dallas, which led for the final time at 15-14 following a driving layup from guard Trey Burke at the 5:18 mark of the first, committed 18 turnovers, which the Rockets converted into 26 points.

Dwight Powell finished with 12 points and four rebounds off the Dallas bench.