diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java
index e485351bd49494179545d7f045246f46d920ec58..650976945c6354325005bce0f5194e17466ea404 100644
--- a/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java
+++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java
@@ -335,4 +335,49 @@ public class GroupController {
         return ResponseEntity.ok(groupService.getUserGroupAssoByUserName(auth.getName()));
     }
 
+
+    /**
+     * Handles the HTTP DELETE request to remove a user from a group.
+     * @param groupId the ID of the group to get the members of
+     * @param username the username of the user to remove from the group
+     * @param auth the authentication object containing the username of the user
+     * @return a ResponseEntity object containing the list of groups the
+     * user is associated with and an HTTP status code of 200,
+     */
+    @DeleteMapping("/removeUser/{groupId}/{username}")
+    public ResponseEntity<?> removeUserFromGroup(@PathVariable("groupId") long groupId,
+                                                 @PathVariable("username") String username,
+                                                 Authentication auth) {
+        Optional<User> groupAdminOpt = userService.getUserFromUsername(auth.getName());
+        if (groupAdminOpt.isPresent()) {
+            User groupAdmin = groupAdminOpt.get();
+            if (!(groupService.isUserAssociatedWithGroup(groupAdmin.getUsername(), groupId)
+                    && (groupService.getUserGroupAssoAuthority(groupAdmin.getUsername(), groupId).equals("ADMIN"))
+            || groupAdmin.getUsername().equals(username)))
+                return ResponseEntity.status(HttpStatus.FORBIDDEN).body("You are not authorized to remove this user.");
+        }
+
+        Optional<Group> groupOpt = groupService.getGroupById(groupId);
+        Optional<User> userOpt = userService.getUserFromUsername(username);
+
+        if (groupOpt.isEmpty() || userOpt.isEmpty()) {
+            return ResponseEntity.notFound().build();
+        }
+
+        User user = userOpt.get();
+        UserGroupAsso userGroupAsso = user.getGroup().stream()
+                .filter(asso -> asso.getGroup().getGroupId() == groupId)
+                .findFirst()
+                .orElse(null);
+
+        if (userGroupAsso != null) {
+            groupService.removeUserFromGroup(userGroupAsso);
+            return ResponseEntity.ok("User removed successfully.");
+        } else {
+            return ResponseEntity.notFound().build();
+        }
+    }
+
+
+
 }
diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/group/Group.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/group/Group.java
index c390052ee47bd59e9df60ff40d80a7db45d52d9e..51dc151a1d66de2e7fd9dc6f254ca3e2b1f6e0f4 100644
--- a/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/group/Group.java
+++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/group/Group.java
@@ -56,8 +56,10 @@ public class Group {
     private ShoppingList shoppingList;
 
 
-    @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},
-            fetch = FetchType.LAZY, mappedBy = "group")
+    @OneToMany(cascade = {CascadeType.ALL},
+            fetch = FetchType.LAZY, mappedBy = "group"
+            , orphanRemoval = true
+    )
     @JsonIgnoreProperties("group")
     private List<UserGroupAsso> user = new ArrayList<>();
 
diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/user/User.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/user/User.java
index 8f9f5967ffd42d4048bf28eb6c6147821fdbc6bd..a3cb4f8fc03861c3f91883853c4ea4ff9bbc6db9 100644
--- a/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/user/User.java
+++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/entity/user/User.java
@@ -55,8 +55,7 @@ public class User implements UserDetails {
     private Date dateOfBirth;
 
 
-    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
-    @JoinColumn(name = "username")
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "user")
     @JsonIgnore
     private List<UserGroupAsso> group;
 
diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/service/group/GroupService.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/service/group/GroupService.java
index e29d843eea7159002b73e946bb6cebcc26eca41f..53daf543777b798f1332672a3ee3ec5831e5fd23 100644
--- a/src/main/java/ntnu/idatt2016/v233/SmartMat/service/group/GroupService.java
+++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/service/group/GroupService.java
@@ -1,5 +1,6 @@
 package ntnu.idatt2016.v233.SmartMat.service.group;
 
+import jakarta.transaction.Transactional;
 import lombok.AllArgsConstructor;
 import ntnu.idatt2016.v233.SmartMat.entity.ShoppingList;
 import ntnu.idatt2016.v233.SmartMat.entity.group.Fridge;
@@ -229,4 +230,27 @@ public class GroupService {
     public List<UserGroupAsso> getUserGroupAssoByUserName(String username) {
         return userGroupAssoRepository.findAllByUserUsername(username);
     }
+
+    /**
+     * removes user_group relatioon
+     * @param username the username of the user
+     * @param groupId the id of the group
+     * @return true if the user is the owner of the group, false otherwise
+     */
+    @Transactional
+    public boolean removeUserFromGroup(UserGroupAsso userGroup) {
+        Group group = groupRepository.findByGroupId(userGroup.getGroup().getGroupId())
+                .orElseThrow(() -> new IllegalArgumentException("Group does not exist"));
+
+        group.getUser().remove(userGroup);
+
+        if (group.getUser().isEmpty()) {
+            groupRepository.delete(group);
+        } else {
+            groupRepository.save(group);
+        }
+
+        userGroupAssoRepository.delete(userGroup);
+        return true;
+    }
 }