Answer Set Programming (ASP) is a declarative problem solving paradigm, rooted in Logic Programming and Nonmonotonic Reasoning, which has been gaining increasing attention during the last years. This course provides a general introduction to ASP and its applications in Knowledge Representation and Reasoning. The first part of the course provides an introduction to the basic concepts and logical foundations of the ASP formalism. We will then consider ASP as a declarative programming paradigm, by providing some insights in programming methods and Answer Set solvers. We will then turn to extensions of ASP, in particular for interfacing external sources of knowledge. In the second part of the course, we will turn to the interaction of ASP with Knowledge Representation languages: we will consider the interaction with Description Logics languages and with aspects of probability. We will then provide some examples of applications of ASP to real application scenarios.