LOS ANGELES — Today’s hot and humid weather will be not just muggy and uncomfortable but also potentially perilous, with a threat of thunderstorms creating a risk of fire-setting lightning strikes and flash flooding while high surf pounds the coast and rip currents bedevil swimmers and surfers, according to National Weather Service forecasts.

In the Antelope Valley, where forecasters expect thunderstorms today, an excessive heat warning expired Monday night, but slightly less ominous heat advisories remains in effect until 10 tonight in the San Gabriel Mountains, where highs will range from 93 to 103, and the Santa Clarita Valley, where a range from 98 to 102 is expected.

“This is a dangerous situation, with an increased threat of life- threatening heat-related illness,” the NWS warned.

The NWS attributed the warming trend to an upper-level high-pressure system strengthening over Northern California and Nevada. Along with high heat, a spike in humidity is expected, which likely will make conditions miserably uncomfortable.

“A surge of monsoonal moisture will move into the forecast area Tuesday through Thursday, bringing increased humidity along with continued hot conditions,” the National Weather service said in a statement, adding that the threat of thunderstorms and humid conditions will persist through Friday..

“… There is a threat of showers and thunderstorms across Los Angeles and Ventura counties” today, and it will extend to Santa Barbara and San Luis Obispo counties tonight through Thursday, it said.

The risk of thunderstorms applies everywhere in Los Angeles County but seems most likely in the Antelope Valley, according to NWS forecasters.

“Due to ample moisture expected with this surge, there will be the potential for brief heavy downpours with any thunderstorms that develop. As a result, the greatest threat with thunderstorms the next few days will be flash flooding, especially in the mountains and deserts, where a flash flood watch will likely be needed” according to the NWS statement.

“In addition, gusty winds and dangerous lightning will be possible with thunderstorms, including beach areas. While most of the storm activity is expected to be wet, the increase threat of lightning strikes may cause new fire ignitions due to the very dry fuels.”

At sea, “any thunderstorms that do develop will be capable of producing gusty winds with rough seas, heavy downpours and dangerous cloud to grown lightning,” according to an NWS statement on ocean conditions. “Mariners are advised to check the latest weather forecasts before heading out of harbor.”

Through much of the week, Southern California will endure a “moderate to high heat risk,” according to the NWS, which noted that heat advisories are already in effect through today and may need to be extended.

“As humidity increases, there will also be warmer overnight low temperatures, adding to the heat stress across Southwest California,” the statement said.

“Anyone planning outdoor activities in the mountains and deserts this week should be prepared for the possibility of monsoonal thunderstorms and the associated flash flood risk if storms do develop.”

Forecasters urged people who work outdoors to save strenuous activities for the early morning or evening, wear light-colored, loose-fitting clothing, and drink plenty of water.

Above all, they said, be aware that “temperatures inside vehicles, even if the windows are partially open, can quickly rise to life-threatening levels. Never, ever leave people or pets in enclosed vehicles, even for a short period of time.”

Along the Southland Coast, a beach hazards statement, which is a notch less serious than a high surf warning, will be in effect through this evening as a long-period southerly swell generates higher-than-normal surf to south- facing beaches. These conditions could persist through Thursday.

Strong rip currents and longshore currents will continue through at least Tuesday evening, NWS forecasters said, adding that the surf will average three to six feet, with local sets to seven feet possible.

“There is an increased risk of ocean drowning,” warned an NWS statement. Rip currents can pull swimmers and surfers out to sea. Large breaking can wash people off beaches and rocks and capsize small boats near shore.”

Forecasters urge swimmers caught in a rip current not to panic but to try to relax and float, remaining parallel to shore until able to break free. “If unable to escape, face the shore and call or wave for help.”

The NWS forecast partly cloudy skies in L.A. County today, along with highs of 79 in Big Bear, San Pedro and Torrance; 80 at LAX; 84 in Avalon and Wrightwood; 85 in Long Beach; 88 in downtown L.A.; 91 on Mount Wilson; 93 in San Gabriel and Whittier; 94 in Burbank, North Hollywood and Van Nuys; 96 in Rancho Cucamonga; 97 in Pasadena and Ontario; 98 in West Covina and Redlands; 99 in Woodland Hills and Northridge; 100 in San Bernardino; 101 in Santa Clarita; 103 in Palmdale; and 104 in Lancaster. A record high for a July 31 was set in Lancaster Monday, when the mercury reached 110, breaking the record of 107 set in 1951.

Partly cloudy skies were also in Orange County’s forecast, along with potentially much more tolerable highs than in L.A. County: 72 in Laguna Beach; 75 in San Clemente; 78 in Newport Beach; 89 in Irvine and Mission Viejo; 90 in Anaheim; and 92 in Fullerton and Yorba Linda.

High temperatures will persist for several days.