Martinez completed 10-of-21 passes for 219 yards and two interceptions for the Cornhuskers (2-0), who squashed the Mocs of Tennessee-Chattanooga, 40-7, last week. He also carried the ball 15 times for 166 yards.
Rex Burkhead also had a big game on the ground, rushing for 55 yards and two touchdowns on 15 carries.
"I said good win. 2-0. I thought we were going to be challenged tonight," Nebraska head coach Bo Pelini said. "I thought it was a good team win, but I also think it's a win that, in all three phases, did some things that obviously didn't help us win the football game. I think all three phases did some things to put us in the situation we were in."
Derek Carr connected on 20-of-41 passes for 254 yards and a touchdown for the Bulldogs (0-2), who lost 36-21 to California last week. Carr also ran for a score.
Robbie Rouse carried the ball 36 times for 169 yards in defeat.
"First of all what I want to say is that our offensive line battled their butts off the entire game," Carr said. "That was a great job by them tonight. (Robbie) Rouse averaging five yards per carry really makes my job a lot easier, opening up the passing game. I'm very proud of him and our defense battled and (Nebraska) just made a couple more plays."
Devon Wylie's 67-yard punt return for a touchdown gave Fresno State a 7-0 lead with 7:45 left in the first quarter.
Martinez started the ensuing Nebraska drive with a 57-yard run. He capped the five-play march with a one-yard rushing touchdown to tie the game.
The Bulldogs promptly responded with a 10-play, 67-yard scoring drive that Carr capped with a three-yard rushing TD for a 14-7 lead.
The Cornhuskers kept the back-and-forth battle going midway through the second period. Martinez started a six-play drive with a 38-yard run. Burkhead rumbled into the end zone from one yard out to make it 14-14 with 4:52 left until half.
Fresno State marched all the way down the field on its next possession, but settled for a 22-yard Kevin Goessling field goal.
The Bulldogs increased their lead early in the second half. The visitors opened the third quarter with a 10-play drive that Goessling capped with a 36- yarder for a 20-14 edge.
Nebraska responded with a touchdown to take the lead. Jamal Turner caught a 43-yard pass before Martinez and Quincy Enunwa hooked up on a 16-yard score for a 21-20 edge.
The Cornhuskers extended their lead early in the fourth. Kyler Reed caught two passes for 61 yards before Burkhead scampered into the end zone from six yards outs.
A.J. Johnson caught a 55-yard pass on the first play of Fresno State's next possession. Josh Harper capped the four-play march with a 26-yard touchdown catch. The two-point conversion failed to keep it a 28-26 game.
Ameer Abdullah made sure the Bulldogs got no closer by taking the ensuing kickoff 100 yards for a touchdown.
Goessling's 37-yarder cut the gap to 35-29, but the Cornhuskers ran the clock down with Burkhead. Six rushing plays preceded a 46-yard Martinez TD run, which made it 42-29 with two minutes to play.
This was the first-ever meeting between these two programs...Nebraska has won 22 consecutive games against WAC opponents...Fresno State has lost 13 straight games to teams ranked in the top-25...Abdullah had five kickoff returns for 211 yards, establishing a Nebraska single-game record. The previous record was 186 yards by Josh Davis on seven returns at Kansas State in 2002. Abdullah's 100-yard kickoff return ties for the second-longest in school history and is just the fourth kickoff return of 100 yards or more in school history.