AbstractIn recent decades, the spotted wing Drosophila (SWD) (Drosophila suzukii), an invasive pest, has caused a great deal of damage to fruit crops. There is therefore an urgent need to develop strategies to control the populations of this species. It has been found that the landscape context can buffer or increase the severity of pest outbreaks in agriculture, and it is important to understand how this process works in SWD for all crops. Given this background, we investigated the influence of forest on SWD populations in raspberry orchards and surrounding agricultural land. We selected 10 locations in the central part of Slovenia, five of which were closer than 200 m from the forest edge and five of which were more than 200 m from the forest edge. We collected SWD adults in three habitat types per location from the end of June until the end of October 2020. The results showed that forest harboured a larger SWD population than orchards and agricultural land. Over the season, the number of individuals increased exponentially over time, and the difference between forest and other habitat types increased. The distance from the forest had a negative effect on the abundance of SWD. There was a difference in abundance observed between males and females, with males being less abundant farther away from the forest than females. However, the distance from the forest only had a negative effect on the abundance of females in September. Based on the results, we propose potential measures for the control of SWD in raspberry orchards.