The transition areas of riverine, estuarine, and marine environments are particularly valuable for the research of microbial ecology, biogeochemical processes, and other physical-chemical studies. Although a large number of microbial-related studies have been conducted within such systems, the vast majority of sampling have been conducted over a large span of time and distance, which may lead to separate batches of samples receiving interference from different factors, thus increasing or decreasing the variability between samples to some extent. In this study, a new in situ filtration system was used to collect membrane samples from six different sampling sites along the Sanya River, from upstream freshwater to the sea, over a nine-hour period. We used high-throughput sequencing of 16S and 18S rRNA genes to analyze the diversity and composition of prokaryotic and eukaryotic communities. The results showed that the structures of these communities varied according to the different sampling sites. The α-diversity of the prokaryotic and eukaryotic communities both decreased gradually along the downstream course. The structural composition of prokaryotic and eukaryotic communities changed continuously with the direction of river flow; for example, the relative abundances of Rhodobacteraceae and Flavobacteriaceae increased with distance downstream, while Sporichthyaceae and Comamonadaceae decreased. Some prokaryotic taxa, such as Phycisphaeraceae and Chromobacteriaceae, were present nearly exclusively in pure freshwater environments, while some additional prokaryotic taxa, including the SAR86 clade, Clade I, AEGEAN-169 marine group, and Actinomarinaceae, were barely present in pure freshwater environments. The eukaryotic communities were mainly composed of the Chlorellales X, Chlamydomonadales X, Sphaeropleales X, Trebouxiophyceae XX, Annelida XX, and Heteroconchia. The prokaryotic and eukaryotic communities were split into abundant, common, and rare communities for NCM analysis, respectively, and the results showed that assembly of the rare community assembly was more impacted by stochastic processes and less restricted by species dispersal than that of abundant and common microbial communities for both prokaryotes and eukaryotes. Overall, this study provides a valuable reference and new perspectives on microbial ecology during the transition from freshwater rivers to estuaries and the sea.