U.S. stocks closed out a strong month on a quiet note on Friday, with the S&P 500 posting a modest gain to close at a new record as the latest positive data helped extend a rally that had been briefly threatened by overseas concerns.

Since falling to a near three-month low on Aug. 7, the S&P 500 has risen in 12 of the past 16 sessions. It is also closed out its fourth straight weekly advance and sixth positive month of the past seven. Friday's gains pushed the index to its latest record close of 2,003.37, its third finish above 2,000 this week.

Wall Street initially lost ground after Britain introduced a note of caution into the market, raising its international terrorism threat level to the second highest in response to possible attacks being planned in Syria and Iraq.

In the latest economic data, business activity in the U.S. Midwest rebounded more than expected in August, signaling a pickup in that region's economy. Separately, U.S. consumer sentiment rose more than expected, according to the final August reading from the Thomson Reuters/University of Michigan Surveys of Consumers.

"We reached and closed above the 2,000 milestone this week and that gets the mental obstacle out of the way," said Andre Bakhos, managing director at Janlyn Capital LLC in Bernardsville, New Jersey.

"Economic numbers have been positive for the most part, people are drawing comfort from these numbers, using them as a justification for optimism."

Economic numbers have helped to offset geopolitical concerns, with flare ups in the conflict between Ukraine and Russia helping to curb gains. Ukraine called for full membership in NATO on Friday, its strongest plea yet for Western military help, after accusing Russia of sending in armored columns that have driven back its forces on behalf of pro-Moscow rebels.

The Dow Jones Industrial average <.DJI> rose 18.88 points, or 0.11 percent, to 17,098.45, the S&P 500 <.SPX> gained 6.63 points, or 0.33 percent, to 2,003.37 and the Nasdaq Composite <.IXIC> added 22.58 points, or 0.5 percent, to 4,580.27.

For the week, the Dow rose 0.6 percent, the S&P advanced 0.7 percent and the Nasdaq was up 0.9 percent, the fourth consecutive week of gains for all three. For the month of August, the Dow added 3.2 percent, the S&P gained 3.8 percent and the Nasdaq finished 4.8 percent higher. The S&P's gain marked its best monthly performance since February.

The week's trading volume has been among the lightest of the year, with action muted going into the Labor Day holiday in the United States. Markets will be closed on Monday.

The U.S. shares of AstraZeneca <AZN.L> <AZN.N> rose 1.8 percent to close at $76.01 on news the company had moved its immuno-oncology medicine MEDI-4736 into a mid-stage study in colorectal cancer.

Splunk Inc <SPLK.O> jumped 19.1 percent to $53.93 a day after posting strong revenue growth and raising its full-year sales outlook.

Volume was thin, with about 3.8 billion shares traded on U.S. exchanges, well below the 5.29 billion average so far this month, according to data from BATS Global Markets.

Advancing stocks outnumbered declining ones on the NYSE by 2,117 to 890, while on the Nasdaq, advances beat declines 1,882 to 790.

(By Chuck Mikolajczak; Editing by Chizu Nomiyama, Meredith Mazzilli and Andre Grenon)