## Introduction

Layered van der Waals materials, such as transition metal dichalcogenides (TMDs), have attracted major interest, thanks to their rich variety of ground states and the possibility of their exfoliation down to an atomically thin level, which remarkably modifies their electronic properties1,2. Recent observations of intriguing physics in artificially assembled heterostructures highlight the importance of interlayer interactions. Examples include the outstanding stability of interlayer excitons in semiconducting TMDs3, and strongly correlated states in twisted bilayer systems4. Relevant aspects of the inter-plane coupling can be deduced by probing out-of-plane charge transport, even in bulk materials5. However, enforcing the current flow strictly along the c axis can be rather challenging due to the crystals’ common flake-like appearance and their propensity for delamination. Such a pitfall can distort the measurement results by orders of magnitude, as demonstrated in our recent study of microstructured samples of 1T-TaS2 with a well-defined current flow6. This observation motivates a careful re-examination of the out-of-plane charge transport properties in this class of materials by adopting the latest state-of-the-art for quantum matter microfabrication7.

Here we present data on the out-of-plane electrical resistivity of bulk monocrystalline 2H-NbS2. This material is one of the three known structural variants of layered NbS2. The two other polytypes are 3R and 1T, the latter occurring only in atomically thin form8,9. As illustrated in Fig. 1a, 1T-NbS2 consists of corner-sharing octahedral NbS6 cells. Layers of 2H- and 3R-NbS2 (Fig. 1b, c) both contain NbS6 units of trigonal prismatic geometry, but exhibit different stacking configurations. The 1T polytype has been attracting interest recently as a candidate for realising a two-dimensional magnetic system10,11. 2H-NbS2 has been actively featured in the literature due to a superconductivity below 6 K, proposed to have a multiband character. It also does not show any charge-density-wave (CDW) order, which is uncommon for metallic TMDs12,13,14,15,16,17. Another distinguishing feature of 2H-NbS2 is its non-trivial synthesis procedure. This polytype is thermodynamically stable in a relatively narrow range of temperatures and reactant stoichiometries18,19,20. Crystals formed during high-temperature growth must be rapidly quenched in order to capture 2H-NbS2 in a metastable room-temperature state. However, X-ray diffraction studies have shown that the resultant material has up to 18% of pairs of neighbouring layers stacked in a 3R-like manner21,22. Additionally, diffuse X-ray scattering experiments22 revealed weak traces of the $$\sqrt {13} \times \sqrt {13}$$ CDW reconstruction, which appears as a triangular superlattice of David-star-shaped clusters defined by 13 Nb atoms23. Such a reconstruction is not expected for pure 2H-NbS2 or 3R-NbS2. Earlier theoretical investigations have predicted 1T-NbS2 to be particularly prone to developing such a CDW order10,11. One can therefore conclude that single crystals of 2H-NbS2 contain rare, atomically thin inclusions of the 1T polytype.

Our study of 2H-NbS2 revealed a remarkably strong low-temperature anomaly in the compound’s out-of-plane resistivity (ρc), manifesting as a minimum at around 40 K, followed by a pronounced upturn upon further cooling. The feature is simultaneously invisible in the in-plane resistivity (ρab), and shows a highly anisotropic response to magnetic field. Neither 2H-NbSe2 nor 3R-NbS2 display such an anomaly, implying that the phenomenon is linked to the structural defects specific to 2H-NbS2. 1T-NbS2, layers of which are one of such defects, were predicted to form a lattice of unpaired localised spins located at the centre of each David-star CDW superlattice cluster10,11. We argue that planes of magnetic moments, hosted by the inclusions of 1T-NbS2, cause a Kondo effect observable only when the current flows across these planes.

## Results

### Resistivity anisotropy

Optimisation of sample geometry with focused ion beam (FIB) micro-milling greatly improves charge transport study precision6,7. Using this approach, we shaped single crystals into samples with well-defined, few micron-thick and -wide current channels, oriented along the two principal directions: normal and parallel to the atomic planes (Fig. 2a shows a sample of 2H-NbS2 produced this way). Such a design allowed simultaneous measurement of both ρab and ρc via the four-point technique. Probing ρc on two segments of different surface-to-volume resulted in mutually consistent values, allowing us to ensure that our results were not distorted by the presence of surface-related effects or macroscopic defects.

Figure 2b shows the plots of ρab and ρc of 2H-NbS2 against temperature (T), as well as their ratio in the inset. Note that in contrast to the earlier study which reports an anisotropy of the order of 1000 (ref. 24), our measured value was as low as 10 at room temperature, monotonically increasing to 180 on cooling. As it was shown for the case of 1T-TaS2 using finite element simulations6, such an overestimate by the previous study could be a result of a non-optimised measurement geometry and an incorrect prior assumption that the anisotropy is very large. While ρab has a conventional metallic temperature dependence, ρc is also metallic, but shows a few noteworthy features. First, the residual out-of-plane resistivity is very high, presumably due to a significant concentration of static defects. Second, ρc approaches saturation in the high-temperature region. This flattening of resistivity may be attributed to the mean free paths decreasing to the point of becoming comparable to the interlayer separation, a concept known as the Mott-Ioffe-Regel limit25. Third, at low temperatures, ρc displays a minimum at around 40 K, with a major upturn at lower temperatures. No corresponding feature exists in ρab (in agreement with the previous results26). All studied samples of 2H-NbS2 showed qualitatively identical behaviour, with slight differences in the absolute values of resistivity—related to slight impurity content variations—and temperatures of the minimum distributed in the 30–40 K range.

We compared ρc of 2H-NbS2 to that of the isostructural and isovalent compound 2H-NbSe2 (dashed line in Fig. 2b). The latter material did not exhibit a similar low-temperature anomaly. Based on the nominal lattice parameters, density functional theory calculations predict that the two compounds will have nearly identical electronic band structures (see Supplementary Note 1 and Supplementary Figs. 1 and 2). We therefore conclude that the upturn of ρc of 2H-NbS2 is not intrinsic to the nominal structure of the compound, but is caused by crystalline lattice defects.

### Seebeck coefficient anisotropy

The Seebeck coefficient (S) is a useful quantity for sensitively probing energy landscape variations near Fermi level. The open-circuit voltage generated by the thermal gradient is unaffected by the presence of static defects such as vacancies or non-magnetic stacking faults. On the other hand, the Seebeck coefficient is a function of the energy dependence of the conduction electron scattering rate. This is then strongly affected by the occurrence of resonance peaks in the density of states close to the chemical potential. Seebeck coefficient of 2H-NbS2 revealed a prominent peak at approximately 15 K, appearing only for the out-of-plane thermal gradient (Fig. 2c). The phonon drag phenomenon produces a similar feature in the temperature dependence. However, it manifests only in conductors with long phonon and charge carrier mean free paths—such as semimetals or extremely pure metals—where momentum-conserving scattering is dominant27. This is highly unlikely for 2H-NbS2, as its high content of static defects should clearly favour momentum-relaxing scattering. Furthermore, absence of the corresponding Sab peak rules out the phonon drag from the possible Sc anomaly origins. An alternative interpretation of the peak, the Kondo effect, will be discussed further below.

### High-field magnetotransport

The out-of-plane resistivity anomaly of 2H-NbS2 demonstrated a particularly curious response to magnetic fields. As can be seen in Fig. 3a, the transverse and longitudinal out-of-plane magnetoresistances of the material are strikingly different. Applying the field along the c axis suppresses the resistivity upturn, shifting the minimum to lower temperature. Yet even at 63 T the anomaly is still present. Consequently, at 50 K and below, ρc decreases when magnetic field is increased, with signs of saturation appearing around 50 T (Fig. 3b). In contrast, in transverse magnetic field, ρc behaves as a more typical orbital magnetoresistance, common to metals. It is positive, and about three times weaker in magnitude than the longitudinal one (Fig. 3c) without significantly affecting the shape of the upturn in ρc(T).

In order to emphasise the observed phenomenon’s highly anisotropic nature, we also report the in-plane magnetotransport of 2H-NbS2 up to 14 T. The magnetoresistance is weak for all field directions, as can be seen in Fig. 4a, but similarly to ρc, ρab is also reduced by the field along the c axis (clearly depicted in Fig. 4b), which could be a trace of the same anomaly. The in-plane field-dependence of ρab (Fig. 4c) is likely governed by orbital effects, like in the case of ρc.

## Discussion

The question of the origin of the anomalies of ρc in 2H-NbS2 will now be addressed. A number of phenomena could result in a finite-temperature resistivity minimum in a metal. Resistivity upturns can be caused by electron–electron interactions in the presence of static disorder28,29,30. However, the corresponding quantum mechanical correction is either weakly enhanced by a magnetic field, or is effectively field-independent. A closely linked phenomenon of weak localisation (WL) is also known to produce an additional contribution to resistivity at low temperatures31. In this scenario, when a series of scattering events cause an electron to follow a closed path, quantum interference favours the net backward scattering over the forward one. Magnetic flux threading these scattering loops shifts the phases of the wave functions, diminishing the effect. In our case, when electrons are scattered between different planes, the closed paths should have comparable projections along the in-plane and out-of-plane directions. However, the upturn is only influenced by the c-axis-oriented field, contradicting the WL-based interpretation. A metal–insulator transition or conduction based on a thermally activated hopping between defects32 would cause a divergence of ρc at the lowest temperatures, which was not the case. The possibility of quantum tunnelling playing a significant role is ruled out based on a linear relation between current and voltage (Supplementary Note 2 and Supplementary Fig. 3). Resistivity upturns have also been observed in strongly doped cuprate superconductors33,34. In those materials, the effect is believed to be caused by scattering from magnetic droplets forming around non-magnetic impurities. This interpretation, however, relies on the existence of strong electronic correlations, and therefore does not apply to our system.

Finite-temperature resistivity minimum in a metal is also a well-known signature of the Kondo effect, a scattering of conduction electrons of dilute localised magnetic moments35. Besides the upturn, the characteristic features of the phenomenon, observable in charge transport, include a negative curvature of ρc(T) at the lowest temperatures and a suppression of the upturn by magnetic field, which causes spin-flip scattering to become inelastic36,37. The observed peak in the Seebeck coefficient is also characteristic to dilute and concentrated spin systems, including Kondo lattices38,39. It originates from the resonant scattering in the Kondo channel at the Fermi level. Above the Kondo temperature, TK, the resonance is smeared out, and depending on the specifics of a system, the peak in S appears at a temperature between 0.3 and 0.9 TK (refs. 39,40). When temperature is low enough, the localised spins are screened and the excitations obey simple power laws, like those of a Fermi liquid. For example, S varies as T/TK for T/TK < 0.1–0.15 for several typical Kondo alloys in the dilute, single impurity limit41.

Measurements of ρc under high pressure, presented in Supplementary Note 3 and Supplementary Fig. 4, show that the upturn remains extremely robust up to the highest achieved pressure of 1.9 GPa. Applying the pressure weakly shifts the minimum of ρc up in temperature. This is consistent with the behaviour expected from Kondo systems42,43.

We therefore argue that scattering of magnetic impurities is the most fitting explanation of our observations. The temperature dependence of ρc in 2H-NbS2 is consistent with the one expected from the numerical renormalisation group (NRG) theory calculations for Kondo effect36,44, as illustrated by the fit in Fig. 3a. We modelled ρc with a sum of three contributions: a temperature-independent residual resistivity ρ0, an electron–phonon scattering term ρe–p (captured by the Bloch-Grüneisen formula) and the Kondo term ρK (the only magnetic-field-dependent term), for which we used the common empirical expression closely following the results of the NRG theory36,44:

$$\rho _{\mathrm{K}}\left( T \right) = \rho _{{{{\mathrm{K0}}}}}\left( {1 + \left( {2^{1/\alpha } - 1} \right)\left( {T/T_{\mathrm{K}}} \right)^2} \right)^{ - \alpha }.$$
(1)

The fitting procedure is described in more detail in Supplementary Note 4, with the help of Supplementary Figs. 5 and 6 and Supplementary Table 1.

This explanation immediately raises a question regarding the nature of our system’s magnetic impurities. The standard scenario where magnetic atoms are uniformly distributed clearly does not fit our picture. Doping 2H-NbS2 with Fe results in the upturn observable in ρab as well as the disappearance of superconductivity45. Additionally, the undoped material does not display a corresponding signature in the heat capacity46. Lack of pronounced anomaly effects on ρab implies that the responsible defects take the form of sparse planes, extending along the layers. When the current then flows along the layers, only a small fraction of the conduction electrons move in close proximity to these planes. But for the out-of-plane current flow, effectively all charge carriers have to pass through them, resulting in a particularly strong influence. Although we observed planar irregularities in the crystalline lattice via transmission electron microscopy, their atomic structure could not be determined due to a limited resolution (see Supplementary Note 5 and Supplementary Figs. 7 and 8). Taking a closer look at the in-plane magnetoresistance for the c-axis-oriented field reveals that the difference between ρab at 0 and 14 T increases linearly with respect to ln(T) between 30 and 15 K (Fig. 4a inset), which further supports our hypothesis. This means that a minute contribution of Kondo scattering is present in ρab, but it is not strong enough to change the sign of the gradient of ρab(T).

The presence of 1T-NbS2 layers, evidenced by the characteristic CDW signatures22, offers a fascinating interpretation of our findings, illustrated in Fig. 5. As we mentioned in the introduction, the $$\sqrt {13} \times \sqrt {13}$$ CDW order, associated with the 1T polytype, forms a triangular superlattice of David-star-shaped clusters defined by 13 Nb atoms23. The electronic structure of monolayer 1T-NbS2 as well as 1T-NbSe2 in such a configuration has been predicted to contain one very flat band around the Fermi level. This makes the materials susceptible to electronic instabilities like Mott localisation, with a concomitant magnetic order10,47,48. The referenced works found the ferromagnetic insulating state as the most stable, although others have proposed that such triangular lattices can host antiferromagnetic spin-liquid phases49,50. These magnetic planes play the role of scatterers in the Kondo effect, however, their concentration appears to be too low for a detection via magnetometry measurements. The described scenario is conceptually similar to the Kondo effect occurring in artificially fabricated magnetic tunnel junctions51,52, yet in our case the phenomenon is observed in a spontaneously formed system. The same kind of Kondo interaction has been very recently observed in scanning tunnelling spectroscopy studies of the 2H/1T or 1H/1T heterostructures of NbSe2 (ref. 53), TaS2 (ref. 54) and TaSe2 (ref. 55), grown by molecular beam epitaxy. One outstanding question is the anomaly’s markedly different response to the two orientations of magnetic field. This difference is probably coming from the localised electron’s highly anisotropic g-factor, causing a very small spin splitting (less than TK), but could also be related to the magnetic ordering. Sizeable anisotropy of the g-factor is expected for systems with strong spin–orbit coupling, such as TMDs50.

Since 2H-NbS2 is known to contain frequent 3R-like stacking faults, it is natural to ask whether the anomaly is somehow caused by the inclusions of 3R-NbS2. We measured the latter compound’s out-of-plane resistivity, and while the corresponding temperature dependence was surprisingly found to be non-metallic, the extremely weak reaction of the interlayer conduction to the longitudinal magnetic field (Δρc/ρc ≈ 0.1% at 14 T) was incompatible with the behaviour observed in 2H-NbS2 (see Supplementary Note 6 as well as Supplementary Fig. 9 for the relevant data on 3R-NbS2). The abundance of these stacking faults could explain the high residual component of ρc. The current understanding is that the poor conductivity of 3R-NbS2 is not intrinsic, but rather originates from the disorder due to self-intercalated Nb atoms56. However, in 2H-NbS2, the abundance of stacking faults results in high residual component of ρc and good in-plane metallicity.

In summary, we have demonstrated that a delicate alternation of the interlayer crystalline structure of 2H-NbS2, by introducing different polymorphs of the same atomic composition, dramatically affects the material’s physical properties. In particular, the crystal’s 2H stacking is occasionally disrupted by the 1T layers, which undergo a CDW instability. This then results in a triangular superlattice of David-star-shaped clusters, each hosting a lone spin at the centre. Such a texture of localised magnetic moments can be seen as a two-dimensional Kondo lattice, immersed into the metallic bulk of the 2H polytype. When the electric field or thermal gradient are then applied along the c axis, electronic transport shows a pronounced Kondo effect manifesting as anomalies in the out-of-plane resistivity and Seebeck coefficient. But when they are applied within the plane, there is no sign of spin-dependent scattering. The observation of this highly anisotropic phenomenon occurring in a naturally formed heterostructure has been made possible, thanks to the careful tailoring of the crystal by FIB. Our work therefore shows the importance of adopting new experimental techniques in studying novel electronic materials, especially highly anisotropic Van der Waals structures.

## Methods

### Focused ion beam microfabrication

Microstructured samples were extracted from monocrystalline flakes of TMDs. The starting crystals had the lateral size of the order of 1 mm and were at least 100 µm thick. After identifying a clean region on a crystal’s surface, free of cracks or buckling, a rectangular lamella was defined by milling away the surrounding material using an FEI Helios G4 Xe plasma FIB microscope. The typical dimensions of a lamella were around 120 µm × 60 µm × 5 µm (with up to 20% variations in lengths between different samples), with the intermediate dimension corresponding to the extent along the c axis of a crystal. The milling current for this stage was 60 nA, with 30 kV column voltage. An FEI Helios G3 Ga FIB microscope was then used for polishing the surface of the lamella with a 1 nA beam in order to ensure the parallelism of the two largest faces. After extraction, the lamella was glued to a sapphire substrate with a tiny amount of Araldite Rapid epoxy, keeping the external face exposed. Besides anchoring the lamella, the epoxy also formed a meniscus around it that smoothly connected the substrate’s surface to the lamella’s exposed face. The setup was then sputter coated with a 100 nm layer of gold. Next, the Ga FIB milling at 10 nA was used for defining the probing electrodes by selectively removing the sputtered gold layer, and for patterning the lamella in order to form the current channel and voltage probing points. The procedure was concluded with polishing the exposed side faces of the sample with a 1 nA ion beam in order to clean the surface of the re-deposited material and define the final dimensions of the device. Since the entire bottom face of the sample was rigidly attached to the substrate, differential thermal contraction and compressibility were expected to produce inhomogeneous stresses throughout the lamella. In our study, these stresses did not have a significant influence on the measured data. More detailed information about the FIB-assisted sample preparation can be found in the relevant review paper7 and references therein.

### Resistivity measurements

Resistivity was measured via the four-point technique with direct or alternating excitation currents in the 20–40 µA range. Temperature sweeps’ rate was limited to 1 K/min for the ambient pressure and of 0.5 K/min for the high-pressure measurements in order to reduce the thermal lag and gradients.

Resistivity at high pressure was measured using a piston cylinder cell produced by C&T Factory. Daphne oil 7474 was used as a pressure-transmitting medium. Pressure was determined from the changes in resistance and superconducting transition temperature of a sample of Pb located next to the 2H-NbS2 sample.

Measurements in high magnetic fields were conducted at the high magnetic field facilities in Grenoble (up to 34 T DC field) and Toulouse (up to 63 T pulsed field). Quantum Design PPMS was used for measurements in fields up to 14 T.

### Seebeck coefficient measurements

Seebeck coefficient was measured using an in-house setup. For the in-plane Seebeck coefficient measurement, a thin and long sample was mounted on a ceramic bar. One end of the bar was connected to the thermal bath, while the other one had a resistive heater attached. A differential thermocouple was used to measure the temperature difference across the sample. The out-of-plane Seebeck coefficient measurement was performed using a setup displayed in Fig. 2c and described in the corresponding caption.