Texas student Kelley Peterson of El Campo, Texas carries a stuffed Little Tex through the Midway with Texas State University student Quinn Dusek, right, before the AT&T Red River Showdown college football game between the University of Texas and Oklahoma University on Saturday, October 14, 2017 at the Cotton Bowl in Fair Park in Dallas. (Ashley Landis/The Dallas Morning News)

Texas student Kelley Peterson of El Campo, Texas carries a stuffed Little Tex through the Midway with Texas State University student Quinn Dusek, right, before the AT&T Red River Showdown college football game between the University of Texas and Oklahoma University on Saturday, October 14, 2017 at the Cotton Bowl in Fair Park in Dallas. (Ashley Landis/The Dallas Morning News)

Ashley Landis/Staff Photographer

It was a close one, Big Tex.

The State Fair of Texas closed its 2017 run Sunday, logging 2.2 million visitors and $54.5 million in coupon sales -- second-best in the festival's history, fair officials said.

Revenue from food, drinks and rides was not as high as it was last year, when it reached $56 million. The visitor count in 2016 was also higher by about 200,000 people.

Officials with the State Fair, a nonprofit, said the proceeds are used for fair operations, scholarships, community outreach and capital improvements. Earlier this year, the fair announced it would give Dallas at least $6 million to improve city-owned Fair Park as the fair faces criticism that it hasn't been a good neighbor to the impoverished families that live around the 277-acre complex.

The fair's security bill also doubled this year to $1 million or more for police overtime.

There were no big scares for Big Tex this season, though fairgoers marked the fifth anniversary of the fire that deep-fried the animatronic cowboy

Here are the highlights of the 2017 festivities, according to fair officials:

11,300 members of the military and their families who redeemed free admission on the inaugural Military Appreciation Day (a boost of 1,700 people compared to last year)

150,000 fairgoers who checked out the Hall of State exhibits, including one on Texans in World War I (a decline from 225,000 for the Taylor Swift Experience in 2016)

$5.1 million in single-day gross coupon sales on Oct. 14, or the Red River Showdown -- a record for the fair

You have a better chance of winning on the Midway than figuring out State Fair's butter sculpture

$1.18 million raised in the Youth Livestock Auction -- a record for young livestock exhibitors

$141,000 for Tex, the record-breaking grand champion steer raised by 12-year-old Tristan Himes of Sterling City

13,000 livestock entries -- another record -- with 8,100 students competing

9,569 entries in the creative arts competitions

$1.3 million in college scholarships to 217 graduating seniors in Texas (a slight increase compared to last year)

249,577 pounds of food collected from various programs and donated to the North Texas Food Bank (a 7 percent dip from last year)

220 pounds of fresh produce donated by the Big Tex Urban Farms

What's Happening on GuideLive