Rainy weather will be replaced by foggy conditions on Long Island Tuesday night, the National Weather Service said.

The forecaster said showers remained likely, mainly before 11 p.m., and then areas of fog are expected after midnight.

There will also be areas of fog early Wednesday, and then showers will return, mainly after noon, according to the National Weather Service.

In all, expected rainfall amounts from Tuesday through Thursday morning include 2.51 inches for MacArthur Airport; 2.40 for Farmingdale, and 2.43 for Westhampton, the weather service said.

“Showers end late Tuesday night,” News 12 Long Island meteorologist Matt Hammer said, “but we’ll see widespread fog overnight that will drop visibility considerably in spots.”

Overnight lows are expected to be around 50 degrees, he said.

advertisement | advertise on newsday

Wednesday opens dry, but clouds and rain dominate again, Hammer said.

“Rain will be developing from mid- to late morning,” Hammer said, and it again will be “heavy at times during the afternoon and evening.”

Daily high temperatures Wednesday push to 54 degrees, with light winds at 6 to 11 mph in the morning.

The rain is needed. Through Sunday, November precipitation amounts at Long Island MacArthur Airport were nine-tenths of an inch, according to weather service data. That’s 2.36 inches below normal for the month.

With Patricia Kitchen and Zachary R. Dowdy